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 (JIRA)" <ji...@apache.org> on 2014/11/07 20:59:35 UTC

[jira] [Resolved] (CXF-6092) When there is bad connection/timeout, ClientImpl throws NullPointerException

     [ https://issues.apache.org/jira/browse/CXF-6092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-6092.
------------------------------
       Resolution: Fixed
    Fix Version/s: 2.7.14
                   3.0.3
         Assignee: Daniel Kulp

Added some NPE checks.  Hopefully that resolves this.

> When there is bad connection/timeout, ClientImpl throws NullPointerException
> ----------------------------------------------------------------------------
>
>                 Key: CXF-6092
>                 URL: https://issues.apache.org/jira/browse/CXF-6092
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.7.11, 2.7.12, 2.7.13, 3.0.2
>            Reporter: Nikolai Penkov
>            Assignee: Daniel Kulp
>             Fix For: 3.0.3, 2.7.14
>
>
> When the connection when executing WebService all is interrupted or timed out, there is some kind of racing issue and the result is
> (the stacktrace and src code is from v. 2.7.11, but the same code is also in the other versions)
> Caused by: java.lang.NullPointerException
>     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:396)
> I suppose the problem is that when the connection is timed out/closed, the 
> destroy() method is called in ClientImpl, where there is a statement that sets 
> responseContext = null;
> and then in the finalize block of the invoke, there is the code that produces the NPE:
> } finally {
>             if (context != null) {
>                 Map<String, Object> resp = CastUtils.cast((Map<?, ?>)context.get(RESPONSE_CONTEXT));
>                 if (resp != null) {
> --NPE----->                    responseContext.put(Thread.currentThread(), resp);
>                 }
>             }
>         }
> One possible solutions is to add verification also for not null value in responseContext.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)