I followed the instructions here for properly installing the latest JAX-WS release (2.2.6) on top of my JDK v1.6.0_31 (i.e. copying the jaxws-api.jar and jaxb-api.jar from the JAX-WS release into my ${JAVA_HOME}/lib/endorsed directory). From inside Eclipse I can run the wsimport ant task properly and the generated code is giving a version stamp in the comments of:
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.6b21
* Generated source version: 2.2
*
*/
The problem I'm having is that the generated client code is showing errors which lead me to believe that the compiler is still using JAX-WS version 2.1:
The constructor Service(URL, QName, WebServiceFeature[]) is undefined
and
The attribute required is undefined for the annotation type XmlElementRef
I tried explicitly setting the -Djava.endorsed.dir arg when starting Eclipse and I also tried setting this arg under Eclipse->Preferences->Java->InstalledJREs but neither of these helped. My wsimport ant task classpath is defined to look at the JAX-WS 2.2.6 jars. I also tried setting my project build path to pull in the 2.2.6 jars. Nothing seems to work. Am I missing something?
Not sure why it's not picking it up front he endorsed lib (other than maybe the endorsed dir you put your libs is for a different JRE/JDK that eclipse is using?), but regarding the last thing you tried... adding the jars directly to the build path.... this will work if you order the build path entries such that your JAX-WS jars are above the JDK entry.
You had produced code that needs JAX-WS 2.1. Version 2.0 does not have WebServiceFeature class, and as result also not constructor in Service with such a argument type.
As you see, in Java SE 6 there is no such a constructor: javax.xml.ws.Service SE 6, but for example in Java EE 6 there is: javax.xml.ws.Service EE 6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With