我使用wsimport任务从.wsdl生成类,我想生成toString方法。我使用的代码是:
<target name="wsimport_v2">
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
<classpath>
<pathelement location="C:\Users\a\Documents\Antin\antifun\lib\jaxws-tools.jar" />
<pathelement location="C:\Users\a\Documents\Antin\antifun\lib\jaxb2-basics-0.6.0.jar" />
<pathelement location="C:\Users\a\Documents\Antin\antifun\lib\jaxb2-basics-tools-0.6.0.jar" />
<pathelement location="C:\Users\a\Documents\Antin\antifun\lib\jaxb2-basics-ant-0.6.0.jar" />
<pathelement location="C:\Users\a\Documents\Antin\antifun\lib\jaxb2-basics-runtime-0.6.0.jar" />
</classpath>
</taskdef>
<mkdir dir="/tmp" />
<wsimport wsdl="/src/wsdl/WebSubscriptionService_v_4.3.wsdl" destdir="/tmp" sourcedestdir="C:\Users\a\Documents\Antin\antifun\src\antifun\generated" keep="true" xnocompile="true">
<xjcArg value="-XtoString"/>
</wsimport>
</target>
但是我得到了
Buildfile: C:\Users\a584187\Documents\Antin\antifun\build.xml
wsimport_v2:
[wsimport] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
BUILD FAILED
C:\Users\a584187\Documents\Antin\antifun\build.xml:13: java.util.ServiceConfigurationError: com.sun.tools.xjc.Plugin: Provider org.jvnet.jaxb2_commons.plugin.tostring.ToStringPlugin could not be instantiated
Total time: 737 milliseconds