我有这个 ant 脚本要运行:
<?xml version="1.0" encoding="utf-8"?>
<project name="WebserviceClient">
<property file="myaxis.properties"/>
<property name="build.dir" value="./src"/>
<path id="axis2.classpath">
<fileset dir="lib">
<include name="*/.jar"/>
</fileset>
</path>
<target name="GenerateGCWebServiceClient" >
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true" dir="${build.dir}">
<classpath refid="axis2.classpath"/>
<sysproperty key="log4j.configuration" value="log4j.properties"/>
<arg value="-uri"/>
<arg value="http://192.168.0.251:9081/Services/MyWebService.svc?wsdl"/>
<arg value="-d"/>
<arg value="adb"/>
<arg value="-ETransfer-Encoding"/>
<arg value="false"/>
<arg value="-S"/>
<arg value="."/>
<arg value="-u"/>
<arg value="-wv"/>
<arg value="1.1"/>
<arg value="-p"/>
<arg value="com.sands.service"/>
<arg value="-ns2p"/>
</java>
</target>
</project>
但它找不到org.apache.axis2.wsdl.WSDL2Java
。这是堆栈跟踪:
> build.xml
property
property
path
GenerateGCWebServiceClient
java
java.lang.NoClassDefFoundError: org/apache/axis2/wsdl/WSDL2Java
Caused by: java.lang.ClassNotFoundException: org.apache.axis2.wsdl.WSDL2Java
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)