The exception information is as follows:
February Geneva, . 9: -: onMorning org.apache.cxf.common.jaxb.JAXBUtils loggeneratedclassnames info: Created classes:com.demo.ObjectFactory, Com.demo.SayHi, Com.demo.SayHiResponse, Com.demo.SayHiToUser, Com.demo.SayHiToUserList, Com.demo.SayHiToUserListResponse, Com.demo.SayHiToUserResponse, Com.demo.UserExceptioninchThread"Main"java.lang.NullPointerException at Org.apache.cxf.common.util.Compiler.useJava6Compiler (Compiler.java:187) at Org.apache.cxf.common.util.Compiler.compileFiles (Compiler.java:141) at Org.apache.cxf.common.util.Compiler.compileFiles (Compiler.java:136) at Org.apache.cxf.endpoint.Dynamic. DYNAMICCLIENTFACTORY.COMPILEJAVASRC (Dynamicclientfactory.java:611) at Org.apache.cxf.endpoint.Dynamic. Dynamicclientfactory.createclient (Dynamicclientfactory.java:370) at Org.apache.cxf.endpoint.Dynamic. Dynamicclientfactory.createclient (Dynamicclientfactory.java:241) at Org.apache.cxf.endpoint.Dynamic. Dynamicclientfactory.createclient (Dynamicclientfactory.java:234) at Org.apache.cxf.endpoint.Dynamic. Dynamicclientfactory.createclient (Dynamicclientfactory.java:189) at Com.demo.HelloWordClient.main (Hellowordclient.java: in)
The above is the online excerpt of a CXF instance, run, and then reported the above error, view the source code, found to be org.apache.cxf.common.util.Compiler usejava6compiler There is a line of code in the method:
Javacompiler compiler = Toolprovider.getsystemjavacompiler ();
Run the above code, found that the return result compiler is NULL, so the above null pointer appears, and then search online to an article
Http://www.cnblogs.com/fangwenyu/archive/2011/10/12/2209051.html
However, the author of this article Java_home is the JRE installation directory, I am the JDK installation directory, but in the same way in the article, the Tools.jar into my and JDK the same level of the JRE, the problem is still resolved.
PS: The installation version of Tomcat, while not setting the environment variables of the JRE, will also find the installation directory of the JRE, neither of which will use the JRE in the JDK installation directory
CXF client dynamic call NULL pointer exception