3

My current web service implementation works fine with Jax-ws , ant and jdk-1.7. My requirement is to migrate from jdk 1.7 to jdk 1.8. But when I am using jdk 1.8 to build , I am getting error when generating wsdl using ant task wsgen as : java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory

On web search found , jdk 8 does not support apt tool any more , need to migrate to annotation processing API . Following is the only link I found with proper guidance on how to have an ant task for it and implement.

https://jax-ws.java.net/nonav/2.2.6/docs/ch04.html#tools-annotation-processing-ant-task

But When I used this and resolved all the compiling issues , now there is file generated in the destination place. Also seems there is no support for wsdl creation in this process.

My full build/web-service process is dependent on apt/wsgen/wsimport. How I can properly migrate them into jdk 1.8 ?

Is there any proper documentation or link to follow to overcome it ?

Code snippet of my wsgen task below :

<taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
        <classpath refid="project.classpath"/>
</taskdef>

<wsgen resourcedestdir="${smruti.wsdl.dir}"
        sei="com.smruti.webservice.SmrutiWebService"
        keep="true"
        sourcedestdir="${smruti.wsdl.dir}\src"
        destdir="${build.dir}"
        genwsdl="true">
        <classpath>
            <path refid="project.classpath"/>
            <pathelement location="${build.dir}"/>
        </classpath>
</wsgen> 
Smruti R Tripathy
  • 789
  • 1
  • 10
  • 15

1 Answers1

3

Which JAX-WS version are you using? Implementation of

    com.sun.tools.ws.ant.WsGen  

has been adapted to new annotation processing API a while ago. Upgrading JAX-WS should resolve the issue.

miran
  • 1,419
  • 1
  • 12
  • 26
  • I was using JAX-WS 2.0 , after upgrading to 2.2.10 , wsdl generation problem solved. But while using wsimport to generate client from the wsgen created wsdl , I am getting following error.. javax.xml.validation.SchemaFactoryConfigurationError: Provider for class javax.xml.validation.SchemaFactory cannot be created – Smruti R Tripathy Mar 18 '15 at 20:07
  • Would you be able to provide data (java, wsdl?) to reproduce the issue? – miran Mar 23 '15 at 10:48