directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob van Maris <r...@jteam.nl>
Subject Problems embedding Apache DS
Date Wed, 12 Aug 2009 10:23:16 GMT
Hi developers,
I want to embed the ApacheDS LDAP server in a small app, for use in
small integration tests. I followed the codesample "Embedding ApacheDS
as a Web Application" at
http://directory.apache.org/apacheds/1.5/43-embedding-apacheds-as-a-web-application.html.

Based on this, here's my code for starting the LDAP server embedded:

    private DirectoryService directoryService;
    private LdapService ldapService;


    // Start directory service.
    directoryService = new DefaultDirectoryService();
    directoryService.setShutdownHookEnabled(true);
    directoryService.setWorkingDirectory(workingDirectory);
    directoryService.startup();

    // Start server.
    ldapService = new LdapService();
    ldapService.setSocketAcceptor(new SocketAcceptor(null));
    ldapService.setDirectoryService(directoryService);
    ldapService.setIpPort(ipPort);
    ldapService.start();

This seemed to work for a while, but unfortunately exceptions start to
occur when multiple threads are connection and trying to create and
lookup different entries at the same time. The error I get is LDAP
error code 54 (LDAP_LOOP_DETECT).

Since the problem does not occur under similar conditions on a
standalone ApacheDS LDAP server, I suspect there's something missing
in my code for initializing and starting the server embedded.

Do you have any idea what's missing? Otherwise, could you point me to
other resources that explain how to embed the LDAP server?

--
Regards!
Rob van Maris

Mime
View raw message