我已将以下内容添加到系统变量
我将%AXIS_LIB%定义为c:\ Axis-1_4 \ lib。
在本教程之后,我尝试使用Java2WSDL生成WSDL文件。
% java org.apache.axis.wsdl.Java2WSDL -o wp.wsdl
-l"http://localhost:8080/axis/services/WidgetPrice"
-n "urn:Example6" -p"samples.userguide.example6" "urn:Example6"
samples.userguide.example6.WidgetPrice
但是,我收到了Class Not Found错误。
C:\axis-1_4\samples\userguide\example6>java org.apache.axis.
wsdl.Java2WSDL -o wp.wsdl -l "http://localhost:8080/axis/services/WidgetPrice" -
n "urn:Example6" -p "samples.userguide.example6" "urn:Example6" samples.userguid
e.example6.WidgetPrice
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/wsdl/
Java2WSDL
Caused by: java.lang.ClassNotFoundException: org.apache.axis.wsdl.Java2WSDL
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.apache.axis.wsdl.Java2WSDL. Program will exi
t.
为什么我无法调用Java2WSDL?
谢谢!
答案 0 :(得分:1)
您仍然需要在类路径中使AXIS_LIB
可用,否则Java将无法找到org.apache.axis.wsdl.Java2WSDL
;您可以将CLASSPATH
设置为%AXIS_LIB%;%CLASSPATH%
或将-cp %AXIS_LIB%
添加到您的命令中来执行此操作。