[ http://issues.apache.org/jira/browse/JCR-57?page=comments#action_60496 ] Marcel Reutegger commented on JCR-57: -------------------------------------
It wasn't my intention to blame eclipse for any of its behaviour. Just took eclipse as an example. I agree with you the shutdown of the observation manager is not optimal, I will change it as you suggested. Still, I think it gives the application using jackrabbit a false sense of security, because the issue might come up again in the future, in an other place with other code. Which eventually makes the change I'm going to implement rather a workaround than a fix for this issue :-/ IMO the solution to this issue is a proper shutdown of jackrabbit with the context classloader that was used when jackrabbit was started. > WorkspaceImpl.dispose() might cause ClassNotFoundException > ---------------------------------------------------------- > > Key: JCR-57 > URL: http://issues.apache.org/jira/browse/JCR-57 > Project: Jackrabbit > Type: Bug > Environment: Jackrabbit SVN 156540 > Reporter: Felix Meschberger > Assignee: Marcel Reutegger > > Wenn using Jackrabbit in an environment, where ClassLoaders may get > inactivated in the sense, the loading new classes is not possible anymore, > shutting down the repository may result in a ClassNotFoundException during > WorkspaceImpl.dispose(). > Reason for this is, that in the dispose() method, the ObservationManager is > asked for all registered event listeners for them to be removed from the > ObservationManager one-by-one. Asking for the listeners results in a new > EventListenerIteratorImpl object being created. > If now, this class has never been used during the live time of the > repository, this would cause a ClassNotFoundException because the class > loader is not laoding classes anymore in the specific environment. > The specific environment is Eclipse, where one plugin is managing different > Repository instances provided by separate plugins. When now the Jackrabbit > provider plugin has already been stopped while the managing plugin tries to > shutdown the Jackrabbit repository, the EventListenerIteratorImpl class > cannot be loaded anymore and disposing the WorkspaceImpl in a controlled way > fails. > I suggest adding an ObservationManagerImpl.dispose() method, which is called > by the WorkspaceImpl like : > WorkspaceImpl.dispose() { > if (obsMgr != null) { > obsMgr.dispose(); > obsMgr = null; > } > } > As a side effect of not calling getObservationManager[Impl]() the observation > manager would also not be created if not existing yet. > As a side effect to having the dispose method is, that the > ObservationManagerImpl class could also do other cleanup work in addition to > clearing the listener lists. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
