cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aki Yoshida (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CXF-4838) Server-side endpoint may throw an NPE when a request message arrives while the endpoint is being stopped but not yet stopped
Date Tue, 19 Feb 2013 18:29:12 GMT
Aki Yoshida created CXF-4838:
--------------------------------

             Summary: 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


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

Mime
View raw message