[英]Java2WSDL (Axis) Class Not Found
我已將以下內容添加到系統變量中
我將%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
但是,我收到“找不到類”錯誤。
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?
謝謝!
您仍然需要在類路徑中使AXIS_LIB
可用,否則Java將無法找到org.apache.axis.wsdl.Java2WSDL
; 您可以通過將CLASSPATH
設置為%AXIS_LIB%;%CLASSPATH%
或在命令中添加-cp %AXIS_LIB%
來執行此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.