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

Providers.getMessageBodyReader throws NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.3
    • 3.1, 3.0.5
    • JAX-RS
    • None
    • Windows

    • Unknown

    Description

      org.apache.cxf.jaxrs.impl.ProvidersImpl.getMessageBodyReader and org.apache.cxf.jaxrs.impl.ProvidersImpl.getMessageBodyWriter are public methods that can be invoke by end user via injected providers.getMessageBodyReader(x,null,x,x).

      Recently we received TCK failure(NPE) on invoke above method when the Type genericType is null.

      the stack trace is:
      at java.lang.Class.isAssignableFrom(Native Method)
      at org.apache.cxf.jaxrs.provider.JAXBElementProvider.objectFactoryOrIndexAvailable(JAXBElementProvider.java:109)
      at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.objectFactoryForType(AbstractJAXBProvider.java:584)
      at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.isSupported(AbstractJAXBProvider.java:570)
      at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.isReadable(AbstractJAXBProvider.java:440)
      at org.apache.cxf.jaxrs.provider.ProviderFactory.chooseMessageReader(ProviderFactory.java:845)
      at org.apache.cxf.jaxrs.provider.ProviderFactory.createMessageBodyReader(ProviderFactory.java:504)
      at org.apache.cxf.jaxrs.impl.ProvidersImpl.getMessageBodyReader(ProvidersImpl.java:45)

      How do you think the value of genericType is null? Is it valid or not. If not we may challenge the TCK case. However the NPE is not allowed.

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            nbqyqx@163.com Neal Hu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: