2
votes

I am using ApacheDS version 2.0.0-M3 (I not very familiar with how this works). I have created a new partition class, extending AbstractPartition. I am able to create an instance of this class, and add it to an ApacheDsService instance.

    File instancePath = new File( param[0] );
    ApacheDsService service = new ApacheDsService();
    InstanceLayout layout = new InstanceLayout( instancePath );

    try
    {
        service.start(layout);
        //
        TestPartition partition = new TestPartition ( layout );
        partition.setSuffix( "ou=test" );
        partition.setSchemaManager( service.getDirectoryService().getSchemaManager() );
        partition.initialize();
        service.getDirectoryService().addPartition( partition );
    }
    catch (Exception x)
    {
        LOG.error("Failed to start the service.", x);
        System.exit(1);
    }

However, when I connect to my server with Apache Directory Studio, I cannot see my partition.

I found this question: How to create a partition in the root in ApacheDS server programmatically using JNDI/LDAP? where kayyagari says that it is necessary to "configure the partition ... in the ou=config area".

I am unsure exactly what is meant by this, and have not had much luck searching the web for details.

I can see the ou=config partition in Apache Directory Studio. I can see other partitions there: ads-partitionId=system and ads-partitionId=example. Looking at the objectClass attributes, I can see that these both have one with the value ads-jdbmPartition. I am unsure whether my partition should have such an entry (as it is not a jdbm partition, but gets its data from a web service).

(Unfortunately, the documentation link for 2.0.0-M3 on the ApacheDS site gives a 404.) How should the LDIF entry for my custom partition look? I cannot get it right, and do not know if I am missing something, or if I have entered something incorrectly.

Any help would be appreciated.

Thanks.

1

1 Answers

1
votes

ApacheDS version 2.0.0-M3 (and 2.0.0-M4) appear to be work in progress. According to the ApacheDS repository version 2.0.0-M3 has not seen any activity since August 2011. In August 2011 the issue with the missing documentation was raised (see: Broken link in web site ("Basic User's Guide" on ApacheDS 2.0 page)).

From the repository you can also see that version 2.0.0-M4 is being worked on currently (with very recent activity). There is some 2.0.0-M3 documentation about. The 2.0.0M3 Maven generated documentation is available. It is also possible to download the 2.0.0-M3 source code which contains numerous unit tests which you could use to decipher the correct approach - the source code is available from Emmanuel Lécharny personal page (but seemingly not on the ApacheDS site itself). Emmanuel Lécharny appears to be the main committer for version 2.0.0-M3 (and Kiran Ayyagari (kayyagari) also appears to be an ApacheDS committer).

Hopefully you now have enough information to allow you to pursue the 2.0.0-M3/M4 route if you so desire.


Owing to the lack of documentation for the 2.x branch, I think it would be MUCH easier for you to use ApacheDS version 1.5.7 (at least until the 2.x branch is documented). The 1.5.7 version includes documentation and working examples such as embedding ApacheDS into an application and into a web application.

I have tried the embedded server sample and was able to access the resulting directory server using the Apache Directory Studio. Interestingly with embedded-sample example the module containing the shared-ldap-schema files is excluded from the classpath (my guess is that this is because the example is minimal implementation and not a fully standards compliant LDAP server).