You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Julian Sedding (JIRA)" <ji...@apache.org> on 2011/09/06 10:06:09 UTC

[jira] [Commented] (FELIX-3104) Registering/unregistering HttpService with CometdServiceImpl repeatedly causes ClassCastException

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

Julian Sedding commented on FELIX-3104:
---------------------------------------

Thanks for the comment, Felix. Your suggested solution was exactly my first take on the issue. However it didn't solve the issue.

The ServletContext is provided by the HttpService and shared/reused, thus registering a new servlet instance doesn't change the context. Maybe the issue could also be solved by explicitly providing an HttpContext argument to the registerServlet method. If I read the code correctly, this will cause a new ServletContext instance to be associated with the servlet.


> Registering/unregistering HttpService with CometdServiceImpl repeatedly causes ClassCastException
> -------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-3104
>                 URL: https://issues.apache.org/jira/browse/FELIX-3104
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http-2.2.0
>            Reporter: Julian Sedding
>            Assignee: Felix Meschberger
>            Priority: Minor
>         Attachments: FELIX-3104-fmeschbe.patch, FELIX-3104.patch
>
>
> CometdServiceImpl uses org.mortbay.cometd.continuation.ContinuationCometdServlet in its implementation, which in turn extends org.mortbay.cometd.AbstractCometdServlet. AbstractCometdServlet places a Bayeux object in a servlet context attribute in its init() method, but never cleans it up on destroy(). This can lead to a ClassCastException if the servlet's init() method is called repeatedly, and the ClassLoader used to create the object stored in the servlet context attribute is not the same that was used to load the AbstractCometdServlet class. However, this is what seems to happen if the cometd bundle is restarted (may only be the case with the patch from FELIX-3102 applied).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira