SlingServletContext timing issue
--------------------------------
Key: SLING-1026
URL: https://issues.apache.org/jira/browse/SLING-1026
Project: Sling
Issue Type: Bug
Components: Engine
Affects Versions: Engine 2.0.4
Reporter: Felix Meschberger
Assignee: Felix Meschberger
Fix For: Engine 2.0.6
The setup and removal of the SlingServletContext has a timing issue, in that it
is registered as a service *before* the sling main servlet is initialized and
it is unregistered *after* the sling main servlet has been destroyed. The
problem is, that the SlingServletContext is based on the servlet context
supplied to the sling main servlet.
So, if the SlingServletContext is registered like this, NullPointerExceptions
may happen when accessing the SlingServletContext.
The fix is to register the SlingServletContext only *after* the sling main
servlet has been initialized and to unregister the SlingServletContext *before*
the sling main servlet is destroyed.
Likewise, the filter registrations must be destroyed *before* the sling main
servlet is destryoed. As such the SlingMainServlet deactivation must operate in
reverse order of SlingMainServlet activation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.