CXF client dynamic call NULL pointer exception

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.