[英]Error java.lang.NoClassDefFoundError: javax/jws/WebService in Java 11
In my cxf webservice invocation while I set the JaxWsProxyFactoryBean service class, I get a fatal error whose trace I have given below.在我设置 JaxWsProxyFactoryBean 服务 class 的 cxf webservice 调用中,我收到了一个致命错误,我在下面给出了它的跟踪。 I am migrating my code from java 8 to java 11.
我正在将我的代码从 java 8 迁移到 java 11。
I have set all the required library jars,cxf bundle and jax-ws jars at my build path but still I am unable to resolve the error.我已经在我的构建路径中设置了所有必需的库 jars,cxf bundle 和 jax-ws jars,但我仍然无法解决错误。 Here is my code:
这是我的代码:
APIWS _stub = null;
JaxWsProxyFactoryBean fac = new JaxWsProxyFactoryBean();
fac.setAddress(API_WS_URL);
fac.setServiceClass(APIWS.class);
_stub = (APIWS) fac.create();
Client c = ClientProxy.getClient(_stub);
HTTPConduit http = (HTTPConduit)c.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setConnectionTimeout(0);
policy.setReceiveTimeout(0);
http.setClient(policy);
c.getInInterceptors().add(new LoggingInInterceptor());
c.getInInterceptors().add(new LoggingOutInterceptor());
ApiWS.aboutCall(_stub);
List<String> output = ApiWS.invokeLiqApiWebService(_stub, transformedQueue);
outputFileList.addAll(output);
Error:错误:
java.lang.NoClassDefFoundError: javax/jws/WebService
at org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialize(JaxWsImplementorInfo.java:273)
at org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImplementorInfo.java:60)
at org.apache.cxf.jaxws.JaxWsClientFactoryBean.setServiceClass(JaxWsClientFactoryBean.java:43)
at org.apache.cxf.frontend.ClientProxyFactoryBean.setServiceClass(ClientProxyFactoryBean.java:224)
at com.qnb.ib.loaniq.inbound.interfaces.process.LIQProcess.callLiqAPI(LIQProcess.java:331)
at com.qnb.ib.loaniq.inbound.interfaces.process.LIQProcess.process(LIQProcess.java:154)
at com.qnb.ib.loaniq.inbound.interfaces.process.LIQJobManager.processJob(LIQJobManager.java:106)
at com.qnb.ib.loaniq.inbound.interfaces.process.LIQJobManager.main(LIQJobManager.java:132)
Caused by: java.lang.ClassNotFoundException: javax.jws.WebService
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 8 more
Need help resolving this issue.需要帮助解决此问题。
Thanks谢谢
These are the jars I have added in my build path to resolve the issue with calling the Web Services.这些是我在构建路径中添加的 jars,以解决调用 Web 服务的问题。
Hope this helps those who are facing similar issue in java 11希望这可以帮助那些在 java 11 中面临类似问题的人
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.