JAX-WS in Java 11 and missing class WebParam$Mode

4.3k views Asked by At

I'm trying to use the wsimport tool in Java 11.

I've obtained an open-source version of jax-ws from the Metro project of Eclipse EE4J, at https://github.com/eclipse-ee4j/metro-jax-ws . I've tried versions 2.3.0 and 2.3.1.

Running wsimport leads to included class WSDLModeler, which includes this import:

import javax.jws.WebParam.Mode;

Which is not included in the jar files in jaxws-ri, leading to:

   [exec] parsing WSDL...
    [exec] Exception in thread "main" java.lang.NoClassDefFoundError: javax/jws/WebParam$Mode
    [exec]  at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.getParameterOrder(WSDLModeler.java:2585)
    [exec]  at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.processLiteralSOAPOperation(WSDLModeler.java:779)
    ...

There is an implementation of WebParam available in the Jakarta project jws-api (Jakarta Web Services Metadata project) -- but under new package name jakarta.jws.WebParam.

Questions

  • Is there a newer replacement for jax-ws that I should be using instead?
  • Or is there an implementation of javax.jws.WebParam from elsewhere I should include in the classpath?
1

There are 1 answers

0
Andy Thomas On

In case anyone else encounters the same issue:

  • The package names had recently changed in the Jakarta project, and other projects had not yet caught up.
  • There were previous releases of the Jakarta project in which the package names were still javax.jws.
  • The binaries and source for a compatible release (1.1.1) were available on repo.eclipse.org here.