You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Wolfgang Müller <wm...@scoop-gmbh.de> on 2013/02/06 16:24:41 UTC

ApacheDS embedded Ldap server example?

Hi there,

I am trying since two days to port a java application using an 1.5.7
embedded Apache Ldap server to 2.0.0.
I found no documentation and no examples how to write an embedded Apache
Ldap server with 2.0.0 on the ApacheDS site, neither on the whole internet.
Thus my new code is a mix of guesses and some code snippets I googled,
but it always fails when it comes to schema loading.

Does anyone of you have a sample embedded Ldap server class that I could
use as a starting point?

Thanks a lot!

-- 
Best regards,
Wolfgang Müller


-  -  -  -  -  -  -
SCOOP Software GmbH
Development - Consulting - Evaluation
wmueller@scoop-gmbh.de
www.scoop-software.de
Tel.:   +49 221 801916-116
Fax:    +49 221 801916-1716
Mobile: +49 175 5901011

Sitz der Gesellschaft: Köln
Handelsregister: Köln
Handelsregisternummer: HRB 36625
Geschäftsführer:
Dr. Oleg Balovnev
Frank Heinen
Roland Scheel
Dr. Wolfgang Reddig


Re: ApacheDS embedded Ldap server example?

Posted by Kiran Ayyagari <ka...@apache.org>.
On Wed, Feb 13, 2013 at 2:00 PM, Wolfgang Müller <wm...@scoop-gmbh.de>wrote:

>
> Am 12.02.2013 17:43, schrieb Kiran Ayyagari:
> >
> >
> > On Tue, Feb 12, 2013 at 10:03 PM, Wolfgang Müller
> > <wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>> wrote:
> >
> >     Thank you very much!
> >     In the meantime I got things running using
> >
> >
> http://svn.apache.org/repos/asf/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
> >
> >     as blueprint for my custom partition (I extend from AvlPartition
> now).
> >
> >     One strange issue is left - I can create and add an AvlPartition with
> >     one or two RDNs, but not more. I.e. a partition with
> "dc=example,dc=com"
> >     works fine. But when I add an AvlPartition with
> >     "dc=department,dc=example,dc=com", trying to add an entry for
> >     "dc=example,dc=com" results in something like "no parent entry
> dc=com"
> >     found, although an entry for "dc=com" was added before.
> >
> > you cannot add a normal(non-context/root) entry with  a DN
> > "dc=example,dc=com" under "dc=department,dc=example,dc=com" cause each
> > child entry should contain the parent's DN
> > for example, if you want to add an entry like "ou=myOrg" in under your
> > partition's context/root
> >  it's DN should be "ou=myOrg,dc=department,dc=example,dc=com"
>
> I see. I added dc=com as an Entry only because the AvlPartition for
> "dc=example,dc=com" did not let me add "dc=example,dc=com" without an
> Entry for dc=com. In the first place. Now, for some magic reason, I can
> omit dc=com.
>
> the context/root entry is different from other entries where you need not
have a "dc=com" while
creating "dc=example,dc=com" (you can have N RDNs in the context/root
entry's DN)

>
> --
> Best regards,
> Wolfgang Müller
>
>
> -  -  -  -  -  -  -
> SCOOP Software GmbH
> Development - Consulting - Evaluation
> wmueller@scoop-gmbh.de
> www.scoop-software.de
> Tel.:   +49 221 801916-116
> Fax:    +49 221 801916-1716
> Mobile: +49 175 5901011
>
> Sitz der Gesellschaft: Köln
> Handelsregister: Köln
> Handelsregisternummer: HRB 36625
> Geschäftsführer:
> Dr. Oleg Balovnev
> Frank Heinen
> Roland Scheel
> Dr. Wolfgang Reddig
>
>
> >
> >     Are partitions restricted to a max of 2 RDNs?
> >
> >
> >     --
> >     Best regards,
> >     Wolfgang Müller
> >
> >
> >     -  -  -  -  -  -  -
> >     SCOOP Software GmbH
> >     Development - Consulting - Evaluation
> >     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
> >     www.scoop-software.de <http://www.scoop-software.de>
> >     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
> >     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
> >     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
> >
> >     Sitz der Gesellschaft: Köln
> >     Handelsregister: Köln
> >     Handelsregisternummer: HRB 36625
> >     Geschäftsführer:
> >     Dr. Oleg Balovnev
> >     Frank Heinen
> >     Roland Scheel
> >     Dr. Wolfgang Reddig
> >
> >
> >     Am 12.02.2013 12:38, schrieb Kiran Ayyagari:
> >     >
> >     >
> >     > On Tue, Feb 12, 2013 at 3:13 PM, Wolfgang Müller
> >     <wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
> >     > <mailto:wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>>>
> >     wrote:
> >     >
> >     >
> >     >     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 <ma...@scoop-gmbh.de>
> >     <mailto:wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>>
> >     >     > <mailto:wmueller@scoop-gmbh.de
> >     <ma...@scoop-gmbh.de> <mailto:wmueller@scoop-gmbh.de
> >     <ma...@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?
> >     >
> >     >     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?
> >     >
> >     > I have just committed a sample program here [1] this uses
> >     JdbmPartition
> >     > but the same steps are
> >     > applicable for AvlParition too
> >     >
> >     > hth
> >     > [1]
> >     >
> >
> https://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk
> >     >
> >     >
> >     >
> >     >     --
> >     >     Viele Grüße / Best regards,
> >     >     Wolfgang Müller
> >     >
> >     >
> >     >     -  -  -  -  -  -  -
> >     >     SCOOP Software GmbH
> >     >     Development - Consulting - Evaluation
> >     >     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
> >     <mailto:wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>>
> >     >     www.scoop-software.de <http://www.scoop-software.de>
> >     <http://www.scoop-software.de>
> >     >     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
> >     <tel:%2B49%20221%20801916-116>
> >     >     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
> >     <tel:%2B49%20221%20801916-1716>
> >     >     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
> >     <tel:%2B49%20175%205901011>
> >     >
> >     >     Sitz der Gesellschaft: Köln
> >     >     Handelsregister: Köln
> >     >     Handelsregisternummer: HRB 36625
> >     >     Geschäftsführer:
> >     >     Dr. Oleg Balovnev
> >     >     Frank Heinen
> >     >     Roland Scheel
> >     >     Dr. Wolfgang Reddig
> >     >
> >     >
> >     >
> >     >
> >     > --
> >     > Kiran Ayyagari
> >     > http://keydap.com
> >
> >
> >
> >
> > --
> > Kiran Ayyagari
> > http://keydap.com
>



-- 
Kiran Ayyagari
http://keydap.com

Re: ApacheDS embedded Ldap server example?

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 2/13/13 9:30 AM, Wolfgang Müller a écrit :
> Am 12.02.2013 17:43, schrieb Kiran Ayyagari:
>>
>> On Tue, Feb 12, 2013 at 10:03 PM, Wolfgang Müller
>> <wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>> wrote:
>>
>>     Thank you very much!
>>     In the meantime I got things running using
>>
>>     http://svn.apache.org/repos/asf/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
>>
>>     as blueprint for my custom partition (I extend from AvlPartition now).
>>
>>     One strange issue is left - I can create and add an AvlPartition with
>>     one or two RDNs, but not more. I.e. a partition with "dc=example,dc=com"
>>     works fine. But when I add an AvlPartition with
>>     "dc=department,dc=example,dc=com", trying to add an entry for
>>     "dc=example,dc=com" results in something like "no parent entry dc=com"
>>     found, although an entry for "dc=com" was added before.
>>
>> you cannot add a normal(non-context/root) entry with  a DN
>> "dc=example,dc=com" under "dc=department,dc=example,dc=com" cause each
>> child entry should contain the parent's DN
>> for example, if you want to add an entry like "ou=myOrg" in under your
>> partition's context/root
>>  it's DN should be "ou=myOrg,dc=department,dc=example,dc=com"
> I see. I added dc=com as an Entry only because the AvlPartition for
> "dc=example,dc=com" did not let me add "dc=example,dc=com" without an
> Entry for dc=com. In the first place. Now, for some magic reason, I can
> omit dc=com.
There is no magic here.

When you create a Parition, you assign a suffix DN to it. Here, if you
created a "dc=example,dc=com" suffix to your partition, then this DN is
considered as  whole single element (ie, it is not necessary nor
possible to create a dc=com entry.

OTOH, if your partition suffix was dc=com, the in order to create a
dc=example,dc=com entry, you would frst have to create a dc=com entry
(the context entry).

This is plain normal, and works as expected. Although I agree that might
sounds weird...


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


Re: ApacheDS embedded Ldap server example?

Posted by Wolfgang Müller <wm...@scoop-gmbh.de>.
Am 12.02.2013 17:43, schrieb Kiran Ayyagari:
> 
> 
> On Tue, Feb 12, 2013 at 10:03 PM, Wolfgang Müller
> <wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>> wrote:
> 
>     Thank you very much!
>     In the meantime I got things running using
> 
>     http://svn.apache.org/repos/asf/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
> 
>     as blueprint for my custom partition (I extend from AvlPartition now).
> 
>     One strange issue is left - I can create and add an AvlPartition with
>     one or two RDNs, but not more. I.e. a partition with "dc=example,dc=com"
>     works fine. But when I add an AvlPartition with
>     "dc=department,dc=example,dc=com", trying to add an entry for
>     "dc=example,dc=com" results in something like "no parent entry dc=com"
>     found, although an entry for "dc=com" was added before.
> 
> you cannot add a normal(non-context/root) entry with  a DN
> "dc=example,dc=com" under "dc=department,dc=example,dc=com" cause each
> child entry should contain the parent's DN
> for example, if you want to add an entry like "ou=myOrg" in under your
> partition's context/root
>  it's DN should be "ou=myOrg,dc=department,dc=example,dc=com"

I see. I added dc=com as an Entry only because the AvlPartition for
"dc=example,dc=com" did not let me add "dc=example,dc=com" without an
Entry for dc=com. In the first place. Now, for some magic reason, I can
omit dc=com.


-- 
Best regards,
Wolfgang Müller


-  -  -  -  -  -  -
SCOOP Software GmbH
Development - Consulting - Evaluation
wmueller@scoop-gmbh.de
www.scoop-software.de
Tel.:   +49 221 801916-116
Fax:    +49 221 801916-1716
Mobile: +49 175 5901011

Sitz der Gesellschaft: Köln
Handelsregister: Köln
Handelsregisternummer: HRB 36625
Geschäftsführer:
Dr. Oleg Balovnev
Frank Heinen
Roland Scheel
Dr. Wolfgang Reddig


> 
>     Are partitions restricted to a max of 2 RDNs?
> 
> 
>     --
>     Best regards,
>     Wolfgang Müller
> 
> 
>     -  -  -  -  -  -  -
>     SCOOP Software GmbH
>     Development - Consulting - Evaluation
>     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
>     www.scoop-software.de <http://www.scoop-software.de>
>     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
>     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
>     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
> 
>     Sitz der Gesellschaft: Köln
>     Handelsregister: Köln
>     Handelsregisternummer: HRB 36625
>     Geschäftsführer:
>     Dr. Oleg Balovnev
>     Frank Heinen
>     Roland Scheel
>     Dr. Wolfgang Reddig
> 
> 
>     Am 12.02.2013 12:38, schrieb Kiran Ayyagari:
>     >
>     >
>     > On Tue, Feb 12, 2013 at 3:13 PM, Wolfgang Müller
>     <wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
>     > <mailto:wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>>>
>     wrote:
>     >
>     >
>     >     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 <ma...@scoop-gmbh.de>
>     <mailto:wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>>
>     >     > <mailto:wmueller@scoop-gmbh.de
>     <ma...@scoop-gmbh.de> <mailto:wmueller@scoop-gmbh.de
>     <ma...@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?
>     >
>     >     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?
>     >
>     > I have just committed a sample program here [1] this uses
>     JdbmPartition
>     > but the same steps are
>     > applicable for AvlParition too
>     >
>     > hth
>     > [1]
>     >
>     https://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk
>     >
>     >
>     >
>     >     --
>     >     Viele Grüße / Best regards,
>     >     Wolfgang Müller
>     >
>     >
>     >     -  -  -  -  -  -  -
>     >     SCOOP Software GmbH
>     >     Development - Consulting - Evaluation
>     >     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
>     <mailto:wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>>
>     >     www.scoop-software.de <http://www.scoop-software.de>
>     <http://www.scoop-software.de>
>     >     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
>     <tel:%2B49%20221%20801916-116>
>     >     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
>     <tel:%2B49%20221%20801916-1716>
>     >     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
>     <tel:%2B49%20175%205901011>
>     >
>     >     Sitz der Gesellschaft: Köln
>     >     Handelsregister: Köln
>     >     Handelsregisternummer: HRB 36625
>     >     Geschäftsführer:
>     >     Dr. Oleg Balovnev
>     >     Frank Heinen
>     >     Roland Scheel
>     >     Dr. Wolfgang Reddig
>     >
>     >
>     >
>     >
>     > --
>     > Kiran Ayyagari
>     > http://keydap.com
> 
> 
> 
> 
> -- 
> Kiran Ayyagari
> http://keydap.com

Re: ApacheDS embedded Ldap server example?

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Feb 12, 2013 at 10:03 PM, Wolfgang Müller <wm...@scoop-gmbh.de>wrote:

> Thank you very much!
> In the meantime I got things running using
>
>
> http://svn.apache.org/repos/asf/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
>
> as blueprint for my custom partition (I extend from AvlPartition now).
>
> One strange issue is left - I can create and add an AvlPartition with
> one or two RDNs, but not more. I.e. a partition with "dc=example,dc=com"
> works fine. But when I add an AvlPartition with
> "dc=department,dc=example,dc=com", trying to add an entry for
> "dc=example,dc=com" results in something like "no parent entry dc=com"
> found, although an entry for "dc=com" was added before.
>
you cannot add a normal(non-context/root) entry with  a DN
"dc=example,dc=com" under "dc=department,dc=example,dc=com" cause each
child entry should contain the parent's DN
for example, if you want to add an entry like "ou=myOrg" in under your
partition's context/root
 it's DN should be "ou=myOrg,dc=department,dc=example,dc=com"

Are partitions restricted to a max of 2 RDNs?
>
>
> --
> Best regards,
> Wolfgang Müller
>
>
> -  -  -  -  -  -  -
> SCOOP Software GmbH
> Development - Consulting - Evaluation
> wmueller@scoop-gmbh.de
> www.scoop-software.de
> Tel.:   +49 221 801916-116
> Fax:    +49 221 801916-1716
> Mobile: +49 175 5901011
>
> Sitz der Gesellschaft: Köln
> Handelsregister: Köln
> Handelsregisternummer: HRB 36625
> Geschäftsführer:
> Dr. Oleg Balovnev
> Frank Heinen
> Roland Scheel
> Dr. Wolfgang Reddig
>
>
> Am 12.02.2013 12:38, schrieb Kiran Ayyagari:
> >
> >
> > On Tue, Feb 12, 2013 at 3:13 PM, Wolfgang Müller <wmueller@scoop-gmbh.de
> > <ma...@scoop-gmbh.de>> wrote:
> >
> >
> >     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 <ma...@scoop-gmbh.de>
> >     > <mailto:wmueller@scoop-gmbh.de <ma...@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?
> >
> >     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?
> >
> > I have just committed a sample program here [1] this uses JdbmPartition
> > but the same steps are
> > applicable for AvlParition too
> >
> > hth
> > [1]
> >
> https://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk
> >
> >
> >
> >     --
> >     Viele Grüße / Best regards,
> >     Wolfgang Müller
> >
> >
> >     -  -  -  -  -  -  -
> >     SCOOP Software GmbH
> >     Development - Consulting - Evaluation
> >     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
> >     www.scoop-software.de <http://www.scoop-software.de>
> >     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
> >     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
> >     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
> >
> >     Sitz der Gesellschaft: Köln
> >     Handelsregister: Köln
> >     Handelsregisternummer: HRB 36625
> >     Geschäftsführer:
> >     Dr. Oleg Balovnev
> >     Frank Heinen
> >     Roland Scheel
> >     Dr. Wolfgang Reddig
> >
> >
> >
> >
> > --
> > Kiran Ayyagari
> > http://keydap.com
>



-- 
Kiran Ayyagari
http://keydap.com

Re: ApacheDS embedded Ldap server example?

Posted by Wolfgang Müller <wm...@scoop-gmbh.de>.
Thank you very much!
In the meantime I got things running using

http://svn.apache.org/repos/asf/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java

as blueprint for my custom partition (I extend from AvlPartition now).

One strange issue is left - I can create and add an AvlPartition with
one or two RDNs, but not more. I.e. a partition with "dc=example,dc=com"
works fine. But when I add an AvlPartition with
"dc=department,dc=example,dc=com", trying to add an entry for
"dc=example,dc=com" results in something like "no parent entry dc=com"
found, although an entry for "dc=com" was added before.
Are partitions restricted to a max of 2 RDNs?


-- 
Best regards,
Wolfgang Müller


-  -  -  -  -  -  -
SCOOP Software GmbH
Development - Consulting - Evaluation
wmueller@scoop-gmbh.de
www.scoop-software.de
Tel.:   +49 221 801916-116
Fax:    +49 221 801916-1716
Mobile: +49 175 5901011

Sitz der Gesellschaft: Köln
Handelsregister: Köln
Handelsregisternummer: HRB 36625
Geschäftsführer:
Dr. Oleg Balovnev
Frank Heinen
Roland Scheel
Dr. Wolfgang Reddig


Am 12.02.2013 12:38, schrieb Kiran Ayyagari:
> 
> 
> On Tue, Feb 12, 2013 at 3:13 PM, Wolfgang Müller <wmueller@scoop-gmbh.de
> <ma...@scoop-gmbh.de>> wrote:
> 
> 
>     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 <ma...@scoop-gmbh.de>
>     > <mailto:wmueller@scoop-gmbh.de <ma...@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?
> 
>     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?
> 
> I have just committed a sample program here [1] this uses JdbmPartition
> but the same steps are
> applicable for AvlParition too
> 
> hth
> [1]
> https://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk
> 
> 
> 
>     --
>     Viele Grüße / Best regards,
>     Wolfgang Müller
> 
> 
>     -  -  -  -  -  -  -
>     SCOOP Software GmbH
>     Development - Consulting - Evaluation
>     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
>     www.scoop-software.de <http://www.scoop-software.de>
>     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
>     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
>     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
> 
>     Sitz der Gesellschaft: Köln
>     Handelsregister: Köln
>     Handelsregisternummer: HRB 36625
>     Geschäftsführer:
>     Dr. Oleg Balovnev
>     Frank Heinen
>     Roland Scheel
>     Dr. Wolfgang Reddig
> 
> 
> 
> 
> -- 
> Kiran Ayyagari
> http://keydap.com

Re: ApacheDS embedded Ldap server example?

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Feb 12, 2013 at 3:13 PM, Wolfgang Müller <wm...@scoop-gmbh.de>wrote:

>
> 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
> > <ma...@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?
>
> 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?
>
> I have just committed a sample program here [1] this uses JdbmPartition
but the same steps are
applicable for AvlParition too

hth
[1]
https://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk

>
> --
> Viele Grüße / Best regards,
> Wolfgang Müller
>
>
> -  -  -  -  -  -  -
> SCOOP Software GmbH
> Development - Consulting - Evaluation
> wmueller@scoop-gmbh.de
> www.scoop-software.de
> Tel.:   +49 221 801916-116
> Fax:    +49 221 801916-1716
> Mobile: +49 175 5901011
>
> Sitz der Gesellschaft: Köln
> Handelsregister: Köln
> Handelsregisternummer: HRB 36625
> Geschäftsführer:
> Dr. Oleg Balovnev
> Frank Heinen
> Roland Scheel
> Dr. Wolfgang Reddig
>
>


-- 
Kiran Ayyagari
http://keydap.com

Re: ApacheDS embedded Ldap server example?

Posted by Emmanuel Lécharny <el...@gmail.com>.
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
>> <ma...@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 


Re: ApacheDS embedded Ldap server example?

Posted by Wolfgang Müller <wm...@scoop-gmbh.de>.
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
> <ma...@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?

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?


-- 
Viele Grüße / Best regards,
Wolfgang Müller


-  -  -  -  -  -  -
SCOOP Software GmbH
Development - Consulting - Evaluation
wmueller@scoop-gmbh.de
www.scoop-software.de
Tel.:   +49 221 801916-116
Fax:    +49 221 801916-1716
Mobile: +49 175 5901011

Sitz der Gesellschaft: Köln
Handelsregister: Köln
Handelsregisternummer: HRB 36625
Geschäftsführer:
Dr. Oleg Balovnev
Frank Heinen
Roland Scheel
Dr. Wolfgang Reddig


Re: ApacheDS embedded Ldap server example?

Posted by Kiran Ayyagari <ka...@apache.org>.
On Fri, Feb 8, 2013 at 5:20 PM, Wolfgang Müller <wm...@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?
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

In one sentence: do you have a simple sample of a custom partition in
> the new 2.0.0 flavour?
>
> --
> Best regards,
> Wolfgang Müller
>
>
> -  -  -  -  -  -  -
> SCOOP Software GmbH
> Development - Consulting - Evaluation
> wmueller@scoop-gmbh.de
> www.scoop-software.de
> Tel.:   +49 221 801916-116
> Fax:    +49 221 801916-1716
> Mobile: +49 175 5901011
>
> Sitz der Gesellschaft: Köln
> Handelsregister: Köln
> Handelsregisternummer: HRB 36625
> Geschäftsführer:
> Dr. Oleg Balovnev
> Frank Heinen
> Roland Scheel
> Dr. Wolfgang Reddig
>
>
> Am 06.02.2013 16:33, schrieb Kiran Ayyagari:
> > take a look at this[1] and let us know if you still run into any issues
> >
> > [1]
> >
> http://svn.apache.org/repos/asf/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
> > On Wed, Feb 6, 2013 at 8:54 PM, Wolfgang Müller <wmueller@scoop-gmbh.de
> > <ma...@scoop-gmbh.de>> wrote:
> >
> >     Hi there,
> >
> >     I am trying since two days to port a java application using an 1.5.7
> >     embedded Apache Ldap server to 2.0.0.
> >     I found no documentation and no examples how to write an embedded
> Apache
> >     Ldap server with 2.0.0 on the ApacheDS site, neither on the whole
> >     internet.
> >     Thus my new code is a mix of guesses and some code snippets I
> googled,
> >     but it always fails when it comes to schema loading.
> >
> >     Does anyone of you have a sample embedded Ldap server class that I
> could
> >     use as a starting point?
> >
> >     Thanks a lot!
> >
> >     --
> >     Best regards,
> >     Wolfgang Müller
> >
> >
> >     -  -  -  -  -  -  -
> >     SCOOP Software GmbH
> >     Development - Consulting - Evaluation
> >     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
> >     www.scoop-software.de <http://www.scoop-software.de>
> >     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
> >     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
> >     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
> >
> >     Sitz der Gesellschaft: Köln
> >     Handelsregister: Köln
> >     Handelsregisternummer: HRB 36625
> >     Geschäftsführer:
> >     Dr. Oleg Balovnev
> >     Frank Heinen
> >     Roland Scheel
> >     Dr. Wolfgang Reddig
> >
> >
> >
> >
> > --
> > Kiran Ayyagari
> > http://keydap.com
>



-- 
Kiran Ayyagari
http://keydap.com

Re: ApacheDS embedded Ldap server example?

Posted by Wolfgang Müller <wm...@scoop-gmbh.de>.
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);

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.

In one sentence: do you have a simple sample of a custom partition in
the new 2.0.0 flavour?

-- 
Best regards,
Wolfgang Müller


-  -  -  -  -  -  -
SCOOP Software GmbH
Development - Consulting - Evaluation
wmueller@scoop-gmbh.de
www.scoop-software.de
Tel.:   +49 221 801916-116
Fax:    +49 221 801916-1716
Mobile: +49 175 5901011

Sitz der Gesellschaft: Köln
Handelsregister: Köln
Handelsregisternummer: HRB 36625
Geschäftsführer:
Dr. Oleg Balovnev
Frank Heinen
Roland Scheel
Dr. Wolfgang Reddig


Am 06.02.2013 16:33, schrieb Kiran Ayyagari:
> take a look at this[1] and let us know if you still run into any issues
> 
> [1]
> http://svn.apache.org/repos/asf/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
> On Wed, Feb 6, 2013 at 8:54 PM, Wolfgang Müller <wmueller@scoop-gmbh.de
> <ma...@scoop-gmbh.de>> wrote:
> 
>     Hi there,
> 
>     I am trying since two days to port a java application using an 1.5.7
>     embedded Apache Ldap server to 2.0.0.
>     I found no documentation and no examples how to write an embedded Apache
>     Ldap server with 2.0.0 on the ApacheDS site, neither on the whole
>     internet.
>     Thus my new code is a mix of guesses and some code snippets I googled,
>     but it always fails when it comes to schema loading.
> 
>     Does anyone of you have a sample embedded Ldap server class that I could
>     use as a starting point?
> 
>     Thanks a lot!
> 
>     --
>     Best regards,
>     Wolfgang Müller
> 
> 
>     -  -  -  -  -  -  -
>     SCOOP Software GmbH
>     Development - Consulting - Evaluation
>     wmueller@scoop-gmbh.de <ma...@scoop-gmbh.de>
>     www.scoop-software.de <http://www.scoop-software.de>
>     Tel.:   +49 221 801916-116 <tel:%2B49%20221%20801916-116>
>     Fax:    +49 221 801916-1716 <tel:%2B49%20221%20801916-1716>
>     Mobile: +49 175 5901011 <tel:%2B49%20175%205901011>
> 
>     Sitz der Gesellschaft: Köln
>     Handelsregister: Köln
>     Handelsregisternummer: HRB 36625
>     Geschäftsführer:
>     Dr. Oleg Balovnev
>     Frank Heinen
>     Roland Scheel
>     Dr. Wolfgang Reddig
> 
> 
> 
> 
> -- 
> Kiran Ayyagari
> http://keydap.com

Re: ApacheDS embedded Ldap server example?

Posted by Kiran Ayyagari <ka...@apache.org>.
take a look at this[1] and let us know if you still run into any issues

[1]
http://svn.apache.org/repos/asf/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
On Wed, Feb 6, 2013 at 8:54 PM, Wolfgang Müller <wm...@scoop-gmbh.de>wrote:

> Hi there,
>
> I am trying since two days to port a java application using an 1.5.7
> embedded Apache Ldap server to 2.0.0.
> I found no documentation and no examples how to write an embedded Apache
> Ldap server with 2.0.0 on the ApacheDS site, neither on the whole internet.
> Thus my new code is a mix of guesses and some code snippets I googled,
> but it always fails when it comes to schema loading.
>
> Does anyone of you have a sample embedded Ldap server class that I could
> use as a starting point?
>
> Thanks a lot!
>
> --
> Best regards,
> Wolfgang Müller
>
>
> -  -  -  -  -  -  -
> SCOOP Software GmbH
> Development - Consulting - Evaluation
> wmueller@scoop-gmbh.de
> www.scoop-software.de
> Tel.:   +49 221 801916-116
> Fax:    +49 221 801916-1716
> Mobile: +49 175 5901011
>
> Sitz der Gesellschaft: Köln
> Handelsregister: Köln
> Handelsregisternummer: HRB 36625
> Geschäftsführer:
> Dr. Oleg Balovnev
> Frank Heinen
> Roland Scheel
> Dr. Wolfgang Reddig
>
>


-- 
Kiran Ayyagari
http://keydap.com