轴 returns 错误 java.lang.NoClassDefFoundError

Axis returns error java.lang.NoClassDefFoundError

我有一个基于 axis2 的 Web 服务,它调用另一个 WebService 来获取一些数据。尝试在 axis2 内某处调用另一个服务时(我不能确切地说出位置,因为它在某个 axis2 class 内)发生错误并作为响应返回:

java.lang.NoClassDefFoundError: org/apache/axis2/jaxws/catalog/impl/OASISCatalogManager

所以我想我没有安装某些库或 class。

在我的文件夹 WebService\WebContent\WEB-INF\classes\org\apache\axis2 中,我看到 2 个文件夹:TransportWebApp

据我所知,class 必须位于 axis2-metadata.jar 内,我已经检查过 - 我的 class 路径中有 "axis2-metadata-1.7.1.jar"。所以我拿了 jaxws/catalog/...etc... 个文件夹,其中包含缺少的 classes(我猜),并将它放在 axis2 文件夹中,就像传输和 webapp 一样,但错误仍然存​​在。

我的错误调用栈:

[ERROR] org/apache/axis2/jaxws/catalog/impl/OASISCatalogManager
java.lang.NoClassDefFoundError: org/apache/axis2/jaxws/catalog/impl/OASISCatalog
Manager
        at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>
(ServiceDescriptionImpl.java:203)
        at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>
(ServiceDescriptionImpl.java:172)
        at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.create
ServiceDescription(DescriptionFactoryImpl.java:134)
        at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.create
ServiceDescription(DescriptionFactoryImpl.java:79)
        at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDe
scription(DescriptionFactory.java:78)
        at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.jav
a:218)
        at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.ja
va:83)
        at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.ja
va:79)
        at javax.xml.ws.Service.<init>(Unknown Source)
        at com.opentext.livelink.service.core.Authentication_Service.<init>(Auth
entication_Service.java:42)
        at com.opentext.livelink.service.fnc.ECMCleansingUtilsSkeleton.GetAuthTo
ken(ECMCleansingUtilsSkeleton.java:201)
        at com.opentext.livelink.service.fnc.ECMCleansingUtilsSkeleton.getWSIDLi
stByDPIDList(ECMCleansingUtilsSkeleton.java:88)
        at com.opentext.livelink.service.fnc.ECMCleansingUtilsMessageReceiverInO
ut.invokeBusinessLogic(ECMCleansingUtilsMessageReceiverInOut.java:51)
        at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusines
sLogic(AbstractInOutMessageReceiver.java:40)
        at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe
ssageReceiver.java:106)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
uest(HTTPTransportUtils.java:176)
        at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
63)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:409)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1044)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:313)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

我该怎么办?我应该以某种方式配置 axis2 以使用那些 class 文件吗?

请帮忙。

您似乎错过了类路径中的 axis2-metadata.jar。添加它,错误应该消失了。