You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (Commented) (JIRA)" <ji...@apache.org> on 2012/03/01 22:37:57 UTC

[jira] [Commented] (CXF-4149) org.apache.cxf.endpoint.ClientImpl raises

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

Daniel Kulp commented on CXF-4149:
----------------------------------


I *THINK* I know what is happening here, but want to clarify with you first.   How are you invoking the async method?  (via a proxy, Dispatch, dynamic client?)    Also, after you call the async method, what are you doing with the object that you invoked it on?   

Can you also try something:  in the handler/callback that you pass to the method, can you add a field that points to the proxy/dispatch/client object?      

My gut feeling is that what is happening is that you are invoking the async method, then discarding the proxy.  The garbage collector is kicking in which is calling destroy on the proxy and thus the client impl.  The destroy on the client impl nulls out a ton of things.   Then then response comes back and now the bus is null.    I THINK if the proxy is held onto even in the handler, it wouldn't be destroyed.

That said, this is a bug, just need to figure out a good way to fix it.   I'm hoping the strong reference can at least provide a workaround for you.

                
> org.apache.cxf.endpoint.ClientImpl raises 
> ------------------------------------------
>
>                 Key: CXF-4149
>                 URL: https://issues.apache.org/jira/browse/CXF-4149
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus
>    Affects Versions: 2.4.4, 2.4.6, 2.5.2
>         Environment: Eclipse Helios, Tomcat 6, JDK 1.6, Windows 7
>            Reporter: Jorge Vaquero
>            Priority: Critical
>
> When invoking several different web services asynchronously a NullPointerException is raised. The web services were invoked firstly in parallel later sequentially. The issue occurs more frequently when the web services are executed in parallel.
> Apparently the issue is at ClientImpl line 715 in version 2.4.4. I've debugged the issue and in some executions bus is null on method onMessage:
>     public void onMessage(Message message) {
>         Endpoint endpoint = message.getExchange().getEndpoint();
>         if (endpoint == null) {
>             // in this case correlation will occur outside the transport,
>             // however there's a possibility that the endpoint may have been
>             // rebased in the meantime, so that the response will be mediated
>             // via a set of in interceptors provided by a *different* endpoint
>             //
>             endpoint = getConduitSelector().getEndpoint();
>             message.getExchange().put(Endpoint.class, endpoint);
>         }
>         message = endpoint.getBinding().createMessage(message);
>         message.getExchange().setInMessage(message);
>         message.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
>         message.put(Message.INBOUND_MESSAGE, Boolean.TRUE);
> ===>    PhaseManager pm = bus.getExtension(PhaseManager.class);
> This is the exception raised:
> GRAVE: ExecutionException
> java.util.concurrent.ExecutionException: java.lang.NullPointerException
> 	at org.apache.cxf.endpoint.ClientCallback.get(ClientCallback.java:147)
> 	at org.apache.cxf.jaxws.JaxwsResponseCallback.get(JaxwsResponseCallback.java:49)
> 	at org.ensure.configLayer.planningLayer.services.PreservationPlanOptimizer.PreservationPlanOptimizer.invokeAnalysisModules(PreservationPlanOptimizer.java:382)
> 	at org.ensure.configLayer.planningLayer.services.PreservationPlanOptimizer.PreservationPlanOptimizer.getOptimizedGlobalPreservationPlans(PreservationPlanOptimizer.java:166)
> 	at org.ensure.configLayer.test.planningLayer.PreservationPlanOptimizer.tester.Tester.main(Tester.java:37)
> Caused by: java.lang.NullPointerException
> 	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:715)
> 	at org.apache.cxf.endpoint.ClientImpl$1.onMessage(ClientImpl.java:890)
> 	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1626)
> 	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1498)
> 	at java.lang.Thread.run(Unknown Source)
> Kind regards,
> Jorge.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira