[
https://issues.apache.org/jira/browse/CXF-4838?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aki Yoshida resolved CXF-4838.
------------------------------
Resolution: Fixed
Fix Version/s: 2.6.7
2.7.4
2.8.0
trunk
http://svn.apache.org/viewvc?view=revision&revision=r1447862
2.7.x
http://svn.apache.org/viewvc?view=revision&revision=r1448140
2.6.x
http://svn.apache.org/viewvc?view=revision&revision=r1448142
> Server-side endpoint may throw an NPE when a request message arrives while
> the endpoint is being stopped but not yet stopped
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: CXF-4838
> URL: https://issues.apache.org/jira/browse/CXF-4838
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.7.3
> Reporter: Aki Yoshida
> Assignee: Aki Yoshida
> Fix For: 2.8.0, 2.7.4, 2.6.7
>
>
> When a server-side endpoint is stopped, it first clears the observable object
> of the destination and then unregister the destination at the service path.
> Because of the order in which these two actions are performed, there is a
> chance for a request message to arrive at the endpoint and still find the
> destination at the service path but its associated observable is already
> null. When this occurs, the call will currently result in an NPE, as shown
> like below:
> SCHWERWIEGEND: Servlet.service() for servlet [cxf-servlet] in context with
> path [/cxf] threw exception
> java.lang.NullPointerException
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:236)
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:130)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:221)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:141)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:197)
> To avoid this problem, we should make sure that these two actions: setting
> and clearing the observer and registering and unregistering the service path
> (destination), to occur in the correct order at starting and stopping of the
> endpoint.
> That means:
> when starting
> - set the observable and register the destination
> when stopping
> - unregister the destination and clear the observable
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira