servicemix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <>
Subject [jira] Work started: (SMXCOMP-812) One-way service method MEP gets NPE on proxy invocation
Date Fri, 08 Oct 2010 05:33:40 GMT


Work on SMXCOMP-812 started by Freeman Fang.

> One-way service method MEP gets NPE on proxy invocation
> -------------------------------------------------------
>                 Key: SMXCOMP-812
>                 URL:
>             Project: ServiceMix Components
>          Issue Type: Bug
>          Components: servicemix-cxf-se
>    Affects Versions: servicemix-xmpp-2010.01
>         Environment: Servicemix 3.3.2 
>            Reporter: Kurt Westerfeld
>            Assignee: Freeman Fang
> The servicemix-cxf-se component gets a NullPointerException (see below) whenever using
> a one-way message exchange pattern, where the method invoked calls a proxy.
> Diagnosis: internally cxf is using the org.apache.cxf.interceptor.OneWayProcessorInterceptor
> class to intercept a one-way method invocation and perform that invocation on
> a separate thread.  The servicemix-cxf-se method handler is depending on being called
> with enough thread context that it can contact other JBI endpoints, but gets an 
> NPE because the endpoint cannot be located.
> Workaround: after digging around, found that the OneWayProcessorInterceptor
> allows invocation inline with the caller's thread, which in this case is 
> the servicemix-cxf-se CxfSeEndpoint.process method which sets up delivery channel
> and other thread-local data.  If the property:
>    org.apache.cxf.interceptor.OneWayProcessorInterceptor.USE_ORIGINAL_THREAD
> is set to true on the bus, or on the message exchange (among others), the
> one-way interceptor will just not process the method.  This fixes the issue.
> The workaround in xbean.xml deployment is to do the following:
>   <cxf:bus>
>     <cxf:properties>
>       <entry key="org.apache.cxf.interceptor.OneWayProcessorInterceptor.USE_ORIGINAL_THREAD"
>     </cxf:properties>
>   </cxf:bus>
> Obviously, this should not be a requirement to workaround this because it 
> took a few hours of source-level debugging through cxf and servicemix to 
> find this workaround.
> Note: my usecase is to use the servicemix-quartz component which can only
> call one-way MEPs.  I did reproduce this problem with servicemix-cxf-bc
> and servicemix-cxf-se so it's not a servicemix-quartz issue.
> Here's the stacktrace of the failure:
>       NOTE: the commitOutputMessage catch of RuntimeException is evil here
>             in not chaining the original exception, but that is a bug in
>             cxf, not servicemix or servicemix-cxf-se
> java.lang.RuntimeException: java.lang.NullPointerException
> 	at org.apache.cxf.transport.jbi.JBIConduitOutputStream.commitOutputMessage(
> 	at org.apache.cxf.transport.jbi.JBIConduitOutputStream.doClose(
> 	at
> 	at org.apache.cxf.transport.AbstractConduit.close(
> 	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(
> 	at org.apache.cxf.frontend.ClientProxy.invokeSync(
> 	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
> 	at $Proxy110.getScheduledCommunities(Unknown Source)
> 	at com.novell.soa.ccm.scheduler.TriggerPortImpl.fireTriggerOperation(
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(
> 	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
> 	at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(
> 	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor$
> 	at java.util.concurrent.Executors$
> 	at java.util.concurrent.FutureTask$Sync.innerRun(
> 	at
> 	at org.apache.cxf.workqueue.SynchronousExecutor.execute(
> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> 	at org.apache.cxf.phase.PhaseInterceptorChain.resume(
> 	at org.apache.cxf.interceptor.OneWayProcessorInterceptor$
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> 	at java.util.concurrent.ThreadPoolExecutor$
> 	at

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message