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)
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)
推荐阅读
-
Android 将view 转换为Bitmap出现空指针问题解决办法
-
在Java8中如何风骚走位的避开空指针异常
-
荐 java程序员最常见的空指针异常java.lang.NullPointerException
-
Idea跑的项目没问题将程序install成jar包运行报错空指针的问题
-
Java自动拆箱空指针异常,救火队员上线
-
C/C++中利用空指针简化代码,提高效率
-
Java中构造方法、空指针异常现象、基本数据类型和引用数据类型作为参数传递的区别
-
std:nothrow不抛异常置空指针
-
Android 将view 转换为Bitmap出现空指针问题解决办法
-
quartz框架定时任务整合springboot报空指针异常解决