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

Vadim Beilin commented on CXF-5504:
-----------------------------------

a way to reproduce it is to add LoggingInInterceptor to 
systests/uncategorized/src/test/java/org/apache/cxf/systest/versioning/ClientServerVersioningTest.java:
{noformat}
@@ -21,11 +21,13 @@ package org.apache.cxf.systest.versioning;
 
 import java.lang.reflect.UndeclaredThrowableException;
 
 import javax.xml.namespace.QName;
 
-
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
 import org.apache.hello_world_mixedstyle.Greeter;
 import org.apache.hello_world_mixedstyle.SOAPService;
 import org.apache.hello_world_mixedstyle.types.GreetMe1;
 import org.apache.hello_world_mixedstyle.types.GreetMeResponse;
@@ -37,10 +39,12 @@ public class ClientServerVersioningTest extends 
AbstractClientServerTestBase {
     private final QName portName = new 
QName("http://apache.org/hello_world_mixedstyle";, "SoapPort");
 
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
launchServer(Server.class));
+        Bus bus = BusFactory.getDefaultBus();
+        bus.getInInterceptors().add(new LoggingInInterceptor());
     }
     
     @Test
     public void testVersionBasedRouting() throws Exception {
 
{noformat}

> AbstractLoggingInterceptor.getMessageLogger throws NPE when 
> MultipleEndpointObserver is used
> --------------------------------------------------------------------------------------------
>
>                 Key: CXF-5504
>                 URL: https://issues.apache.org/jira/browse/CXF-5504
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.5
>            Reporter: Vadim Beilin
>
> 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:
> {noformat}
> 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]
> ...
> {noformat}
> Would it be possible to check first if endpoint is present?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to