WSDL2Java 抛出无法找到主类:org.apache.axis.wsdl.WSDL2Java

发布于 2024-08-22 14:14:02 字数 1245 浏览 4 评论 0原文

我正在尝试从远程 Web 服务创建 java 文件。我下载了 axis 1.4,将 lib 文件夹复制到 c:\data\axis\lib 其中包含以下文件:

  • axis.jar
  • axis-ant.jar
  • commons-discovery-0.2.jar
  • commons-logging- 1.0.4.jar
  • jaxrpc.jar
  • log4j.properties
  • log4j-1.2.8.jar
  • saaj.jar
  • wsdl4j-1.5.1.jar

我将 c:\data\axis\lib 文件夹添加到 <代码>%AXISCLASSPATH%。现在我尝试使用此cmd创建java类:

java -cp %AXISCLASSPATH% org.apache.wsdl.WSDL2JAVA http://myurl.com?wsdl

但是我不断收到以下错误消息:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/wsdl/
WSDL2Java
Caused by: java.lang.ClassNotFoundException: org.apache.axis.wsdl.WSDL2Java
        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.WSDL2Java.  Program will exit.

有人可以帮助我让它工作吗?

I am trying to create the java files from a remote webservice. I downloaded axis 1.4, copied the lib folder to c:\data\axis\lib which contains of these files:

  • axis.jar
  • axis-ant.jar
  • commons-discovery-0.2.jar
  • commons-logging-1.0.4.jar
  • jaxrpc.jar
  • log4j.properties
  • log4j-1.2.8.jar
  • saaj.jar
  • wsdl4j-1.5.1.jar

I added the c:\data\axis\lib folder to the %AXISCLASSPATH%. Now I am trying to create the java classes using this cmd:

java -cp %AXISCLASSPATH% org.apache.wsdl.WSDL2JAVA http://myurl.com?wsdl

However I keep getting the following error message:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/wsdl/
WSDL2Java
Caused by: java.lang.ClassNotFoundException: org.apache.axis.wsdl.WSDL2Java
        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.WSDL2Java.  Program will exit.

Can someone help me to get this working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

巷子口的你 2024-08-29 14:14:02

如果您使用的是 6 之前的 Java 版本,请将 jar 单独添加到类路径中。如果您使用的是 Java 6,请参阅 此处 如果您想使用通配符。

Add the jars to the classpath individually if you're using a Java version before 6. If you're using Java 6, see here if you want to use wildcards.

紧拥背影 2024-08-29 14:14:02

尝试

java -cp %AXISCLASSPATH% org.apache.wsdl.WSDL2Java http://myurl.com?wsdl

类名区分大小写

try

java -cp %AXISCLASSPATH% org.apache.wsdl.WSDL2Java http://myurl.com?wsdl

Class names are case sensitive

少跟Wǒ拽 2024-08-29 14:14:02

以 eucalyptis 身份登录并编译,它将找到所有的罐子 - 这花了我很长时间才弄清楚!

Login as eucalyptis and compile and it will find all of the jars - this took me forever to figure out!

日暮斜阳 2024-08-29 14:14:02

包结构错误。请使用 org.apache.axis.wsdl.WSDL2Java

package structure is wrong. Please use org.apache.axis.wsdl.WSDL2Java

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文