gpt4 book ai didi

apache - com.sun.ws.rs.ext.RuntimeDelegateImpl 错误

转载 作者:行者123 更新时间:2023-12-03 14:43:40 27 4
gpt4 key购买 nike

请帮忙
目前我正在构建一个系统,允许一些 web 服务 (Axis2) 调用 restful (jersey 1.12)
场景是这样的:

客户端 --> webservice (Axis2) --> restful services (Jersey 1.12) ...在tomcat Apache 7中运行
每当我尝试调用 Jersey 时都会出现一些问题。说

java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl

这里是apache中的完整错误,
[ERROR] java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl 
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.jav
a:212)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic
(RPCMessageReceiver.java:117)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusines
sLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe
ssageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
uest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
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.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun
.ws.rs.ext.RuntimeDelegateImpl
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:112)

at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:99)
at wsPackage.TweetClass.getBaseURI(TweetClass.java:46)
at wsPackage.TweetClass.tweet(TweetClass.java:39)
... 29 more
Caused by: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateIm
pl
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1701)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1546)
at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:44)
at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:141)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:95)
... 34 more

我猜这是由于在 apache lib 或我的axisservice lib中丢失了一些jar
实际上我把所有的 Jersey jar 都放到了axisservice lib中
但是每当我从客户端尝试它时(如我在上面的场景中所示)它都不起作用。

请指教,提前谢谢

最佳答案

com.sun.ws.rs.ext 包以及 RuntimeDelegateImpl 包含在 jersey 客户端 jar 中。如果您使用的是 maven,那么将此依赖项添加到您的 pom.xml 中(这里我使用的是 jersey client v1.12):

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.12</version>
</dependency>

关于apache - com.sun.ws.rs.ext.RuntimeDelegateImpl 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9666584/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com