directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <joerg.schai...@gmx.de>
Subject Howto create default system partition
Date Thu, 25 Mar 2010 16:28:09 GMT
Hi folks,

we used the ApacheDS 1.5.4 for some unit tests. I like to upgrade the code 
for 1.5.6, but it currently fails with a NPE at startup, because there's no 
(no longer ?) automatically a system partition available. While there is a 
call to set one, what do I have to do to initialize a default system 
partition like the one used automatically in 1.5.4?

=============== %< ==============
final DirectoryService directoryService = new DefaultDirectoryService();
directoryService.setShutdownHookEnabled(false);
directoryService.setWorkingDirectory(workingDir);
directoryService.getChangeLog().setEnabled(false);
//directoryService.setSystemPartition(???);  <=== What do I need here

final Partition partition = this.addPartition("test", BASE_DN);
directoryService.addPartition(partition);
this.addIndex(partition, "objectClass", "cn", "sn");

final LdapServer ldapServer = new LdapServer();
ldapServer.setDirectoryService(directoryService);
ldapServer.setAllowAnonymousAccess(true);
ldapServer.setSearchBaseDn(BASE_DN);
ldapServer.setTransports(new TcpTransport(port));

server = new ApacheDS(ldapServer);
server.startup();
=============== %< ==============

And - yes, we're still dealing with JUnit 3.x.

Thanks,
Jörg


Mime
View raw message