I don't know anything about 1.0.x.

For 1.5.1 you need to include o.a.d.server/apacheds-bootstrap- partition/1.5.1/jar in your classpath, probably as a maven dependency???

You'll need to figure out some way to either get each server to bind to different ports or to prevent them from binding to any ports and use in-vm access. (this appears to be the problem you got using 1.0.x)

IIUC how to set up servers like this is likely to change soon in trunk, hopefully to something easier to understand and do :-)

thanks
david jencks

On Sep 4, 2007, at 8:46 AM, Derek Alexander wrote:




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.getInitia lContext(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.getInitia lContext(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.UniqueResourceE xception: 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.g etUniqueResource(DbFileListing.java:139)
        at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.g etUniqueResourceAsStream(DbFileListing.java:129)
        at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.i nit(DbFileListing.java:82)
        at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.< init>(DbFileListing.java:51)
        at
org.apache.directory.server.schema.bootstrap.partition.SchemaPartition Extractor.<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.getInitia lContext(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.


Reply via email to