cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fadi Mohsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5689) NPE at ThreadLocalProviders.getContextResolver()
Date Sun, 11 Oct 2015 17:15:07 GMT

    [ https://issues.apache.org/jira/browse/CXF-5689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14952345#comment-14952345
] 

Fadi Mohsen commented on CXF-5689:
----------------------------------

[~sergey_beryozkin] for me, this happens in server/service, and happens sporadically (painful)
:
{code}
 java.lang.NullPointerException
  at org.apache.cxf.jaxrs.impl.tl.ThreadLocalProviders.getContextResolver(ThreadLocalProviders.java:50)
  at com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider._locateMapperViaProvider(JacksonJsonProvider.java:198)
  at com.fasterxml.jackson.jaxrs.base.ProviderBase.locateMapper(ProviderBase.java:864)
  at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:758)
  at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1337)
  at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1288)
  at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:824)
  at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:787)
  at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:212)
  at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
  at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
  at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
  at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
  at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:234)
  at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1129)
  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1065)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
  at org.eclipse.jetty.server.Server.handle(Server.java:497)
  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
  at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
  at java.lang.Thread.run(Thread.java:745)
{code} 

> NPE at ThreadLocalProviders.getContextResolver()
> ------------------------------------------------
>
>                 Key: CXF-5689
>                 URL: https://issues.apache.org/jira/browse/CXF-5689
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.11
>            Reporter: Hooman Valibeigi
>            Assignee: Sergey Beryozkin
>             Fix For: 3.0.0, 2.7.12
>
>
> I have extensions of the following classes in my application used as providers when creating
jaxrs clients or servers.
> javax.ws.rs.ext.ContextResolver
> javax.ws.rs.ext.MessageBodyReader
> javax.ws.rs.ext.MessageBodyWriter
> javax.ws.rs.ext.ExceptionMapper
> org.apache.cxf.jaxrs.client.ResponseExceptionMapper
> All my custom providers have the following member field injected at runtime.
> @Context private Providers providers;
> Within the providers' methods I'm calling this:
> providers.getContextResolver(aClass, aMediaType);
> This is causing a NullPointerException for the ResponseExceptionMapper. All the other
providers have no problem getting the context resolver.
> java.lang.NullPointerException
>         at org.apache.cxf.jaxrs.impl.tl.ThreadLocalProviders.getContextResolver(ThreadLocalProviders.java:50)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message