taskdef class com.sun.tools.ws.ant.WsImport cannot be found Following "The java web services tutorial" -
i saw same issue in many different locations , after portion of googling, not resolve it. trying (the bigger picture) go through the java web services tutorial, seems @ points out of sync,
specially here, when try compile, following message:
c:\javaeetutorial5\examples\jaxws\common\targets.xml:26: taskdef class com.sun.tools.ws.ant.wsimport cannot found
i have tried many different combinations of placing jars or changing environment variables, no result. successful stories?
the full build error message following:
build failed
c:\javaeetutorial5\examples\jaxws\helloservice\build.xml:4: following error occurred while executing line:
c:\javaeetutorial5\examples\jaxws\common\targets.xml:26: taskdef class needed class com.sun.tools.ws.ant.wsimport cannot found: org/apache/tools/ant/dynamicconfigurator
using classloader antclassloader[c:\program files (x86)\java\jdk1.6.0_23\lib\tools.jar]
total time: 0 seconds
and corresponding taskdef:
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.wsimport"> <classpath refid="jaxws.classpath"/> </taskdef>
also peek endorsement directory:
c:\javaeetutorial5\kschneid>cd %java_home% c:\program files (x86)\java\jdk1.6.0_23>dir lib\endorsed volume in drive c osdisk volume serial number aaaa-bbbb directory of c:\program files (x86)\java\jdk1.6.0_23\lib\endorsed 25/02/2011 09:34 <dir> . 25/02/2011 09:34 <dir> .. 25/02/2011 09:34 105,134 jaxb-api.jar 25/02/2011 09:33 54,476 jaxws-api.jar 2 file(s) 159,610 bytes 2 dir(s) 110,907,056,128 bytes free c:\program files (x86)\java\jdk1.6.0_23>
well, apparently link website solution issue unacceptable, i'll paste 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 due relevant jaxws jar not being in class path see pathelement node above. adding jar classpath resolves issue.
Comments
Post a Comment