directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: ApacheDS embedded Ldap server example?
Date Tue, 12 Feb 2013 10:40:07 GMT
Le 2/12/13 10:43 AM, Wolfgang Müller a écrit :
> Am 08.02.2013 17:07, schrieb Kiran Ayyagari:
>>
>> On Fri, Feb 8, 2013 at 5:20 PM, Wolfgang Müller <wmueller@scoop-gmbh.de
>> <mailto:wmueller@scoop-gmbh.de>> wrote:
>>
>>     Thank you very much, that worked for me.
>>     But there is one problem left - I have a custom partition that I create
>>     and add to the directory service like this:
>>
>>     DefaultDirectoryServiceFactory factory = new
>>     DefaultDirectoryServiceFactory();
>>     factory.init("Test");
>>     service = factory.getDirectoryService();
>>     Partition partition = new MyPartition();
>>     partition.setId("My");
>>     partition.setSuffixDn(new Dn("dc=mycompany,dc=com"));
>>     service.addPartition(partition);
>>
>> this looks fine
>>
>>     The getSuffixDn() method of MyPartition just returns the Dn that was set
>>     with setSuffixDn.
>>
>>     But when I connect to my ldap server with ADS, I cannot see my
>>     "dc=mycompany,dc=com" entries below the root DSE. And ldap searches
>>     against "dc=mycompany,dc=com" are responded by my custom partition, but
>>     they result in exceptions on the server side.
>>
>> do you see the value "dc=mycompany,dc=com" in "namingContexts" attribute
>> of RootDSE entry?
> Yes, I see three namingContexts attributes: "ou=system" and "ou=schema"
> and "dc=mycompany,dc=com".
>
>> if yes, then your partition is added. To see and use your partition the
>> context entry for "dc=mycompany,dc=com" needs to be added
> What do you mean with "context entry needs to be added"? How do I do that?

The Context Entry is an LDAP entry associated with the partition you
have created (here, dc=mycompany, dc=com). You have to create the
associated entry.
>
> Well, I am getting a little desperate - to get things working, I added a
> normal AvlPartition and tried to add a top level element to it. But all
> I get are exceptions - this is a very time consuming process of guessing
> and guessing. Do you really have no simple example for a 2.0.0 flavour
> partition? Or at least a code snippet that successfully adds entries to
> an AvlPartition?
It would be more useful to post the error you've got.

However, I'm quite 100% sure that the error you get trying to add new
entries is just due to the fact that you dont have a context entry, as
Kiran said.

Just try to add an entry under ou=system, and it should work. Now,
create the dc=mycompany, dc=com entry, and you should be able to add new
entries under this DN.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Mime
View raw message