directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendy Irawan <he...@soluvas.com>
Subject How to Embed ApacheDS Server 2.0.0-M6 in a Java webapp
Date Sun, 25 Mar 2012 18:57:24 GMT
Hi ApacheDS developers,

I've been trying to embed ApacheDS 2.0 into Java webapp but have not been
successful yet. I also am not able to find documentation so I'm just
guessing so far.

I've made the entire example project open source here :
https://github.com/soluvas/dsembed

So anyone can checkout the project and join.

So far this what I tried :

LdapServer ldapServer = new LdapServer();
ds = new ApacheDS(ldapServer);

InstanceLayout layout = new InstanceLayout("/tmp/dsembed_data");
ds.getDirectoryService().setInstanceLayout(layout);
DefaultSchemaManager schemaManager = new DefaultSchemaManager();
ds.getDirectoryService().setSchemaManager(schemaManager);
SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
ds.getDirectoryService().setSchemaPartition(schemaPartition);
LdifPartition systemPartition = new LdifPartition(schemaManager);
systemPartition.setId("system");
systemPartition.setSuffixDn(new Dn("ou=system"));
ds.getDirectoryService().setSystemPartition(systemPartition);

ds.startup();

Howevr it still causes this error :

Caused by:
org.apache.directory.shared.ldap.model.exception.LdapOtherException:
org.apache.directory.shared.ldap.model.exception.LdapOtherException:
ERR_217 Entry ou=schema contains no objectClass attribute: Entry
    dn[n]: ou=schema
    objectclass: organizationalUnit
    objectclass: top
    ou: schema
    entryUUID: 599d6437-409b-4918-a20c-3efebe3e8f4d
    creatorsname: uid=admin,ou=system
    entryCSN: 20120325184926.328000Z#000000#000#000000

    at
org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:77)
[apacheds-core-api-2.0.0-M6.jar:2.0.0-M6]
    at
org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1821)
[apacheds-core-2.0.0-M6.jar:2.0.0-M6]
    at
org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:1258)
[apacheds-core-2.0.0-M6.jar:2.0.0-M6]
    at
org.apache.directory.server.configuration.ApacheDS.startup(ApacheDS.java:166)
[apacheds-server-jndi-2.0.0-M6.jar:2.0.0-M6]
    at org.soluvas.dsembed.DirectoryEngine.init(DirectoryEngine.java:78)
[classes:]
    ... 43 more


Any help will be appreciated. Thank you !

-- 
Hendy Irawan - on Twitter <http://twitter.com/hendybippo> - on
LinkedIn<http://id.linkedin.com/in/hendyirawan>
Web Developer | Bippo Indonesia <http://www.bippo.co.id/> | Akselerator
Bisnis | Bandung

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message