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

NPE may be thrown in WS-RM scenarios at the server side when rebasing the response

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.2
    • 2.3.3, 2.4
    • WS-* Components
    • None

    Description

      Some WS-RM scenarios may sometimes result in the following exception at the provider/server side under the piggyback mode..

      java.lang.NullPointerException: null
      at org.apache.cxf.ws.addressing.ContextUtils$2.getBackChannel(ContextUtils.java:471) ~[org.apache.cxf.cxf-bundle-2.3.2.jar:2.3.2]
      at org.apache.cxf.interceptor.OneWayProcessorInterceptor.handleMessage(OneWayProcessorInterceptor.java:87) ~[na:na]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) ~[org.apache.cxf.cxf-bundle-2.3.2.jar:2.3.2]
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
      ...

      The cause of this problem seems to be in the rebaseResponse method of org.apache.cxf.ws.addressing.ContextUtils, where the destination endpoint is determined in the following code:

      421                     Destination destination = createDecoupledDestination(
      422                         exchange, reference);
      423                     exchange.setDestination(destination);
      

      As this reference parameter could become null, it needs a similar handling as in the code a few lines above:

      388                                                             reference == null
      389                                                             ? ContextUtils.getNoneEndpointReference()
      390                                                             : reference 
      

      Alternatively, the reference variable can be set to ContextUtils.getNoneEndpointReference() at the beginning of this rebaseResponse method to prevent this problem.

      This problem does not occur in 2.2.x because this second use/reference of the referece variable is only present in 2.3.x.

      I believe this change will solve this issue.

      Regards, aki

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            ay Akitoshi Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified