Wink JsonProvider抛出java.lang.reflect.UndeclaredThrowableException

时间:2015-07-25 00:36:58

标签: apache-wink

我有一个使用Wink客户端调用JAX-RS服务的jax-ws服务。 当我将代码部署到服务器(WAS 7.0.0.29)并测试服务时,我得到了一个在RAD中没有发生的异常(包含在下面)。

通过更多跟踪我可以找到的是java.lang.reflect.UndeclaredThrowableException被抛出。当JsonProvider.write尝试获取回调参数时,会出现异常。

无法确定导致异常的原因我采用了JsonProvider源并为Throwable添加了一个额外的catch,并将此类放在类路径中,然后从Wink发行版开始。这使我的服务成功(因为我们没有使用回调)。

现在我知道异常的来源,但是我无法确定它确实指示缺少哪个类。我需要帮助找出可能缺少的东西。

[7/24/15 6:41:55:984 PDT] 00000046 WebServiceExc E org.apache.axis2.jaxws.WebServiceExceptionLogger log A java.lang.NoClassDefFoundError throwable was caught.  The detail message is:  at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
    at com.sun.proxy.$Proxy60.getQueryParameters(Unknown Source)
    at org.apache.wink.providers.json.JsonProvider.writeTo(JsonProvider.java:96)
    at org.apache.wink.providers.json.JsonProvider.writeTo(JsonProvider.java:53)
    at org.apache.wink.client.internal.handlers.AbstractConnectionHandler.writeEntity(AbstractConnectionHandler.java:116)
    at org.apache.wink.client.internal.handlers.httpclient.ApacheHttpClientConnectionHandler.access$200(ApacheHttpClientConnectionHandler.java:72)
    at org.apache.wink.client.internal.handlers.httpclient.ApacheHttpClientConnectionHandler$EntityWriter.writeTo(ApacheHttpClientConnectionHandler.java:405)
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:98)
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:122)
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:271)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:197)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:257)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:713)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:518)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
    at org.apache.wink.client.internal.handlers.httpclient.ApacheHttpClientConnectionHandler.processRequest(ApacheHttpClientConnectionHandler.java:113)
    at org.apache.wink.client.internal.handlers.httpclient.ApacheHttpClientConnectionHandler.handle(ApacheHttpClientConnectionHandler.java:87)
    at org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(HandlerContextImpl.java:52)
    at org.apache.wink.client.internal.handlers.AcceptHeaderHandler.handle(AcceptHeaderHandler.java:79)
    at org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(HandlerContextImpl.java:52)
    at org.apache.wink.client.internal.ResourceImpl.invoke(ResourceImpl.java:228)
    at org.apache.wink.client.internal.ResourceImpl.invoke(ResourceImpl.java:189)
    at org.apache.wink.client.internal.ResourceImpl.post(ResourceImpl.java:315)
    at net.flowers.ecommerce.personalization.PersonalizationClient.createKey(Unknown Source)
    at com.bco.retail.externalservices.esb.personalization.servicefacade.PersonalizationService.createKey(Unknown Source)
    at com.bco.retail.externalservices.esb.personalization.servicefacade.PersonalizationServiceDelegate.createKey(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at org.apache.axis2.jaxws.server.dispatcher.JavaDispatcher.invokeTargetOperation(JavaDispatcher.java:120)
    at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(JavaBeanDispatcher.java:117)
    at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:111)
    at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:161)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:189)
    at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
    at com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.doPost(WASAxis2Servlet.java:1442)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:307)
    at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:576)
    at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:250)
    at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:259)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:944)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:507)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3954)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:945)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1656)

我还有Wink Trace日志记录中的以下内容,它在开始调用getQueryParameters之后立即注销并继续重复(比下面显示的次数多)并且似乎在抛出异常时结束。

[7/24/15 16:46:01:840 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:840 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null
[7/24/15 16:46:01:840 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - Getting ContextResolver for interface javax.ws.rs.core.UriInfo which has @Produces compatible with */*
[7/24/15 16:46:01:841 PDT] 00000054 SystemOut     O TRACE  ProvidersRegistry - ContextResolvers MediaTypeMap was empty so returning null

我非常感谢您解决此问题的任何帮助。

谢谢

0 个答案:

没有答案