我想创建一个动态客户端来调用我创建的 Web 服务。我尝试JaxWsDynamicClientFactory
按照其官方网站中的说明使用,但没有得到任何输出。相反,我得到NullPointerException
.
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client c = dcf.createClient("http://localhost:8080/service/SearchingSEI?wsdl");
第二行是抛出异常。
堆栈跟踪:
Exception in thread "main" 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:599)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:367)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:235)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:228)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:183)
at com.client.dynamic.DynamicClientFactory.main(DynamicClientFactory.java:24)
我不知道问题是什么。任何建议都会有很大帮助。谢谢。