Monday, February 22, 2010

JAX-WS issues with Netbeans

I was adding a web service reference to one of my web applications when I tried to refresh and regenerate the Java classes from WSDL I received the following error:-

init:
wsimport-init:
C:\Projects\proj_name\nbproject\jaxws-build.xml:22: taskdef class com.sun.tools.ws.ant.WsImport cannot be found
BUILD FAILED (total time: 0 seconds)


If I include the library JAX-WS 2.2, I get the following error:-

wsimport-client-clean-NiceLabel:
init:
wsimport-init:
wsimport-client-NiceLabel:
Created dir: C:\Projects\proj_name\build\generated\jax-wsCache\NiceLabel
C:\Projects\proj_name\nbproject\jaxws-build.xml:31: You are running on JDK6 which comes with JAX-WS 2.1 API, but this tool requires JAX-WS 2.2 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on .
BUILD FAILED (total time: 0 seconds)

The way I solved it was the download an older version of JAX-WS ie 2.0. The jar files you will need are:-
1. Download jaxws-tools-2.0.jar
2. Download jaxws-rt-2.0.jar
3. Download jaxws-rt-2.0.jar
4. Download jaxb-xjc.jar

1 comment:

  1. I was running netbean 6.9 and was having the same problem. I went to the older version of netbean I was running (6.5) and coppied
    C:\Program Files (x86)\NetBeans 6.5\java2\modules\ext\jaxws2a\
    jaxws-rt.jar
    jaxws-tools.jar

    and paste these 2 files in my netbean 6.9 directory
    C:\Program Files (x86)\NetBeans 6.9\java\modules\ext\jaxws22

    and it resolve the problem below:

    You are running on JDK6 which comes with JAX-WS 2.1 API, but this tool requires JAX-WS 2.2 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on .
    BUILD FAILED (total time: 0 seconds)

    Thanks for your solution...

    Garyd

    ReplyDelete

Thank you for your feedback