0

嘿,我正在尝试使用轴 1.4 获取客户端 Java 类,但是当我尝试从命令提示符运行以下命令时,我看到 NO CLASS DEF FOUND ... 请帮助解释原因

WSDL file location: C:\
WSDL2JAVA .class location: C:\axis-1_4\lib\org\apache\axis\wsdl\WSDL2JAVA


C:\>java -classpath \axis-1_4\lib org.apache.axis.wsdl.WSDL2Java -v -o -s d:\gen
erate C:\MyWebService.wsdl


Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.lo
gging.LogFactory
        at org.apache.axis.components.logger.LogFactory.class$(LogFactory.java:4
5)
        at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45
)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory
.java:41)
        at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java
:33)
        at org.apache.axis.i18n.ProjectResourceBundle.<clinit>(ProjectResourceBu
ndle.java:53)
        at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.jav
a:32)
        at org.apache.axis.utils.Messages.<clinit>(Messages.java:36)
        at org.apache.axis.wsdl.WSDL2Java.<clinit>(WSDL2Java.java:112)
4

1 回答 1

1

您需要检查 commons-logging.jar 是否在您的类路径中(在您的示例中,在 C:\axis-1_4\lib 中)。查看本指南,“安装 Axis 和使用本指南”部分。

UPD:我突然想到,您需要使用通配符将“lib”文件夹中的所有 jar 添加到类路径:C:\axis-1_4\lib*

看看这个 Oracle 文档

于 2013-08-23T06:27:52.600 回答