[ http://issues.apache.org/jira/browse/JCR-57?page=comments#action_60488 ]
     
Marcel Reutegger commented on JCR-57:
-------------------------------------

Interesting problem ;)

So, you're saying in an eclipse environment, jackrabbit is not allowed to 
create instances of classes on shutdown that it never used while it was 
running? This seems to be a rather strong restriction. I guess your proposed 
change will probably solve the issue. But what about other code that we write 
in the future, we'd always have to keep in mind that restriction.

Maybe we're not looking at the real issue? Isn't the real cause, that 
jackrabbit registeres itself with a shutdown hook to the JVM? and then shuts 
down too late, when some context class loader is not available anymore?

Who controls startup and shutdown in your environment? Is it possible to find a 
more 'symetric' way to control the life-cycle of jackrabbit (controlled startup 
and shutdown) in respect to classloaders?

Maybe we should also re-consider that shutdown hook we have in the 
RepositoryImpl class. However I consider this a safety feature which shuts down 
jackrabbit properly if RepositoryImpl.shutdown() is not called before the JVM 
exits.

> 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

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

Reply via email to