title: Error java.lang.NoClassDefFoundError: javax/jws/WebService in Java 11
body: <p>In my cxf webservice invocation while I set the JaxWsProxyFactoryBean service class, I get a fatal error whose trace I have given below. I am migrating my code from java 8 to java 11.</p>
  <p>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.
  Here is my code:</p>
  <pre><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&lt;String&gt; output = ApiWS.invokeLiqApiWebService(_stub, transformedQueue);
          outputFileList.addAll(output);
  </code></pre>
  <p>Error:</p>
  <pre><code>java.lang.NoClassDefFoundError: javax/jws/WebService
  at org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialize(JaxWsImplementorInfo.java:273)
  at org.apache.cxf.jaxws.support.JaxWsImplementorInfo.&lt;init&gt;(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
  </code></pre>
  <p>Need help resolving this issue.</p>
  <p>Thanks</p>