directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derek Alexander <D.Alexan...@lse.ac.uk>
Subject Re: Shutdown and multiple ADS instances
Date Tue, 04 Sep 2007 15:46:39 GMT



Derek Alexander wrote:
> 
> Am looking to use ADS within an integration test for some LDAP
> failover/recovery code.
> For this I want to use three instances and starting and stopping at
> appropriate points in the test.
> 

Further to my original post, I've delved a bit deeper. It seems after all
that one can have multiple instances per JVM.

Have found the constructors for MutableServerStartupConfiguration and
ShutdownConfiguration that take a String instanceId param.

However, using 1.0.2 ran into a problem where if I start two instances at
once and then stop them, I get this warning:

15402 [main] WARN  org.apache.directory.server.jndi.ServerContextFactory  -
Failed to sent NoD.
java.lang.IllegalArgumentException: Address not bound: 0.0.0.0/0.0.0.0:40389
        at
org.apache.mina.transport.socket.nio.SocketAcceptor.unbind(SocketAcceptor.java:226)
        at
org.apache.directory.server.jndi.ServerContextFactory.stopLDAP0(ServerContextFactory.java:619)
        at
org.apache.directory.server.jndi.ServerContextFactory.afterShutdown(ServerContextFactory.java:130)
        at
org.apache.directory.server.core.DefaultDirectoryService.shutdown(DefaultDirectoryService.java:279)
        at
org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext(AbstractContextFactory.java:110)

followed by an error when I try to start them again:

org.apache.directory.shared.ldap.exception.LdapConfigurationException:
Failed to bind an LDAP service (40389) to the service registry. [Root
exception is java.net.BindException: Address already in use]
        at
org.apache.directory.server.jndi.ServerContextFactory.startLDAP0(ServerContextFactory.java:499)
        at
org.apache.directory.server.jndi.ServerContextFactory.startLDAP(ServerContextFactory.java:413)
        at
org.apache.directory.server.jndi.ServerContextFactory.afterStartup(ServerContextFactory.java:212)
        at
org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:239)
        at
org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext(AbstractContextFactory.java:118)
...
Caused by: java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind(Native Method)
        at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
        at
org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor.java:429)
        at
org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:52)
        at
org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:258)
        at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
        at java.lang.Thread.run(Thread.java:595)


Figured to try out 1.5.1 instead, the examples don't seem to have been
updated since 1.0.x, so I'm a bit in the dark here. Am getting the following
error. Perhaps I'm missing a dependency?

org.apache.directory.server.schema.bootstrap.partition.UniqueResourceException:
Problem locating bootstrap partition database file list.  Be sure there is
exactly one bootstrap partition jar in your classpath.
No resources named
'org/apache/directory/server/schema/bootstrap/partition/DBFILES' located on
classpath
        at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.getUniqueResource(DbFileListing.java:139)
        at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.getUniqueResourceAsStream(DbFileListing.java:129)
        at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.init(DbFileListing.java:82)
        at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.<init>(DbFileListing.java:51)
        at
org.apache.directory.server.schema.bootstrap.partition.SchemaPartitionExtractor.<init>(SchemaPartitionExtractor.java:43)
        at
org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:834)
        at
org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:255)
        at
org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext(AbstractContextFactory.java:124)
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
        at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)
        at
javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:82)

Any pointers appreciated.

Thanks,
Derek



-- 
View this message in context: http://www.nabble.com/Shutdown-and-multiple-ADS-instances-tf4360101.html#a12480841
Sent from the Apache Directory Project mailing list archive at Nabble.com.


Mime
View raw message