欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CXF 空指针异常

程序员文章站 2022-06-11 08:25:28
...
java.lang.NullPointerException
        at org.apache.cxf.common.util.Compiler.useJava6Compiler(Compiler.java:189)
        at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:143)
        at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:138)
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.compileJavaSrc(DynamicClientFactory.java:598)
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:367)
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:270)
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:263)
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:198)
        at main.java.demo.hw.client.Client.main(Client.java:43)



在调用
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient("http://localhost:8087/xxx?wsdl");
报错,空指针,是因为编译环境的jre需要是jdk下的jre。重新设置,OK空指针不见了。



"java.lang.ClassNotFoundException: com/sun/tools/ " is often occurs if you use JRE in your IDE intead of JDK. Make sure, you use JDK in IDE (e.g. eclipse)
相关标签: CXF