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

AbstractLoggingInterceptor.getMessageLogger throws NPE when MultipleEndpointObserver is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 3.0
    • Core
    • None
    • Unknown

    Description

      The method AbstractLoggingInterceptor#getMessageLogger(Message) that was introduced by CXF-3888 assumes that message.getExchange().getEndpoint() is not null.

      This assumption does not work if one uses org.apache.cxf.transport.MultipleEndpointObserver as the message observer, leading to NPE:

      java.lang.NullPointerException: null
      	at org.apache.cxf.interceptor.AbstractLoggingInterceptor.getMessageLogger(AbstractLoggingInterceptor.java:78) ~[cxf-2.5.9.jar:2.5.9]
      	at org.apache.cxf.interceptor.LoggingInInterceptor.handleMessage(LoggingInInterceptor.java:73) ~[cxf-2.5.9.jar:2.5.9]
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) ~[cxf-2.5.9.jar:2.5.9]
      	at org.apache.cxf.transport.MultipleEndpointObserver.onMessage(MultipleEndpointObserver.java:98) [cxf-2.5.9.jar:2.5.9]
      ...
      

      Would it be possible to check first if endpoint is present?

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            vadimb Vadim Beilin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: