You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Jörg Schaible <jo...@gmx.de> on 2010/03/25 17:28:09 UTC
Howto create default system partition
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
Re: Howto create default system partition
Posted by Jörg Schaible <jo...@gmx.de>.
Kiran Ayyagari wrote at Donnerstag, 25. März 2010 18:39:
> hi Jörg,
>
> Please take a look at the DefaultDirectoryServiceFactory class
> to instantiate the DirectoryService
>
> [1]
> http://svn.apache.org/viewvc/directory/apacheds/trunk/core-
annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?view=markup
>
> HTH
It did, thanks! :)
- Jörg
Re: Howto create default system partition
Posted by Kiran Ayyagari <ay...@gmail.com>.
hi Jörg,
Please take a look at the DefaultDirectoryServiceFactory class
to instantiate the DirectoryService
[1]
http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?view=markup
HTH
Kiran Ayyagari