directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Temple (JIRA)" <>
Subject [jira] Commented: (DIREVE-330) Allow the installation of the shutdown handler to be optional for embedded servers
Date Fri, 27 Jan 2006 11:26:45 GMT
    [ ] 

Simon Temple commented on DIREVE-330:

I can offer some more information on how the embedded server interacts with jBoss...

I have created a directory MBean service:  (see

As you may expect, it has stopService() and startService() methods.  

When the MBean is deployed the startService() method is called which in-turn starts the directory.

The problem is that when jBoss is stopped (ie. * its * shutdown handler is called), stopService()
is called on each deployed MBean in reverse dependency order (i.e.  all service that rely
upon the directory are stopped first and then finally the directory is stopped)

The directory MBean stopService() calls:

            ShutdownConfiguration cfg = new ShutdownConfiguration(  );
            Hashtable env = createContextEnv(  );
            env.putAll( cfg.toJndiEnvironment(  ) );
            new InitialDirContext( env );

The problem I have is that the directory shutdown hook is being called when the jBoss shutdown
hook is called.  Your hook shuts down the directory immediately.  This does not allow the
dependent service to gracefully stop their interactions with the directory.

The directory shutdown hook defeats the AS un-deployment dependency linkages.  For this reason
I feel that when directory is deployed as an MBean service in JBoss the use of a shutdown
hook should be made optional.

Please feel free to comment on this 'Sales Pitch'   ;-)

> Allow the installation of the shutdown handler to be optional for embedded servers
> ----------------------------------------------------------------------------------
>          Key: DIREVE-330
>          URL:
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.4
>  Environment: Windows/UNIX JDK 1.4 - Embedded server within JBoss
>     Reporter: Simon Temple
>     Assignee: Alex Karasulu
>     Priority: Minor

> I am using the directory embedded in JBoss.  When we shutdown JBoss our
> application services need to remove certain entries from the directory.
> Unfortunately the shutdown handler in DefaultDirectoryServices closes Eve
> out before we get chance to finish and we get errors:
> org.apache.ldap.common.exception.LdapServiceUnavailableException:
> Context operation unavailable when invoked after Eve provider has been
> shutdown
> When our services finally stop, we stop the directory using the
> ShutdownConfiguration class so we don't really need the additional shutdown
> thread.
> I've commented out the shutdown hook code and our server is now behaving
> how we want but I don't like running with patched source...

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message