Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5689

NPE at ThreadLocalProviders.getContextResolver()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.11
    • Fix Version/s: 3.0, 2.7.12
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      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)

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              hoomanv Hooman Valibeigi
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: