Details
Description
Class org.apache.directory.server.jndi.ServerContextFactory
internally uses a flag ldapStarted (and ldapsStarted which I think suffers of the same problem)
that probably should be set when ldap is started, otherwise the ldap server will not shut down when in SeverContextFactory.afterShutdown(...)
I Fixed the code for my purposes and hope you will be able to make use of it:
In ServerContextFactory.startLDAPS( ServerStartupConfiguration, Hashtable):
...
chain = ( IoFilterChainBuilder ) Class.forName( "org.apache.directory.server.ssl.LdapsInitializer", true,
ServerContextFactory.class.getClassLoader() ).getMethod( "init", new Class[]
).invoke( null, new Object[]
);
ldapsStarted=true;//FIX Geospa added this line
...
In ServerContextFactory.startLDAP0( ServerStartupConfiguration, Hashtable):
...
tcpAcceptor.bind( new InetSocketAddress( port ), protocolProvider.getHandler(), acceptorCfg );
ldapStarted=true;//FIX Geospa added this line
...