I saw the same issue in many different locations and even after a good portion of googling, I could not resolve it. What I am trying to do (the bigger picture) is to go through
You can fix the problem in Netbeans x.y as follows:
where x.y = 7.1, 7.2, 8.0 etc
Well, apparently a link to a website with the solution to this issue is unacceptable, so I'll paste the answer here:
<property name="BUILD_LIBS" location="C:/Projects/Build/Libs/" />
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
<classpath>
<pathelement location="${BUILD_LIBS}/jaxws-ri/lib/jaxws-tools.jar"/>
</classpath>
</taskdef>
The issue is due to the relevant jaxws jar not being in the class path see the pathelement node above. Adding the jar to the classpath resolves the issue.
I fully support non-IDE development, especially when trying to learn something ;). Try starting with this simple build file (use the actual location of your JAX-WS RI install):
<project name="jaxws-tutorial" default="wsimport">
<property name="jaxws.home" location="D:/jaxws-ri-2_2_1"/>
<path id="wsimport.classpath">
<fileset dir="${jaxws.home}/lib" includes="jaxws-tools.jar"/>
</path>
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" classpathref="wsimport.classpath"/>
<target name="wsimport">
<wsimport>
<arg value="-version"/>
</wsimport>
</target>
</project>
If you just run ant
, you should see some output like the following:
wsimport:
[wsimport] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
[wsimport] JAX-WS RI 2.2.1-b01-
Since it looks like you're using Java 6, pay attention to "Running on JDK6".
I had the same problem after testing Netbeans 11 and then going back to Netbeans 8.2. The solution was the file
ProjectName\nbproject\private\private.properties
that one had an entry
user.properties.file=XXXX\\AppData\\Roaming\\NetBeans\\11.0\\build.properties
changing it back to the correct installation
user.properties.file=XXXX\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
solved the problem. For some projects Netbeans popped up a dialogbox "The project ProjectName uses build.properties
from another Netbeans installation", then click "Use this installation".
To get past this error we need to use Tools->Options, click Miscellaneous, and in the Ant tab use Add Jar/ZIP to locate and add the libraries webservices-tools.jar and webservices-rt.jar in the directory
I changed the classname="com.sun.tools.ws.ant.WsImport"
to classname="com.sun.tools.ws.WsImport"
, which fixed this issue for me.