File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes JNDI Tutorial/LDAP examples/OpenLDAP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI Tutorial/LDAP examples/OpenLDAP" Watch "JNDI Tutorial/LDAP examples/OpenLDAP" New topic

JNDI Tutorial/LDAP examples/OpenLDAP

Randy Gibbons

Joined: Feb 06, 2005
Posts: 14
I'm teaching myself elementary JNDI using Sun's JNDI Tutorial. The tutorial has name/file service provider exercises and directory/ldap service provider exercises. No problem with the naming service exercises (using an fs provider service I downloaded from Sun), but question about the ldap (and I know nothing to speak of about ldap):

I'm using SDK 1.4.2, so I've got the ldap service provider built in.I downloaded and installed (on Windows XP) a Win32 bundling of OpenLDAP from Lucas Bergman. To my amazement, my JNDI Tutorial directory service exercises connect to the OpenLDAP server. But the exercises require loading tutorial.ldif into the directory server, and I can't get past an "invalid credentials" error when running ldapadd.exe.

I know the problem concerns the directory server config file ldap.conf and Access Control. I've looked through the Quick Start and man for OpenLDAP and tried to hack out a ldap.conf that works, but I'm working in the blind. If my diagnosis is right, then I'm looking for the simplest but correct ldap.conf, with a superuser who can bind/write anything. Any help appreciated in validating my diagnosis and giving me a ldap.conf I can use.

Here's what I'm putting in at the command line:

I'm prompted for and enter password "secret." I get back an
error message.

Here is my ldap.conf file, copied from an example given in the OpenLDAP manual, with my (perhaps erroneous) changes of Unix directory syntax to that of Windows:
clive jordan
Ranch Hand

Joined: Apr 27, 2005
Posts: 39
try lower-case 'w' on the command line.
Randy Gibbons

Joined: Feb 06, 2005
Posts: 14
Thanks. I had tried that too. Since I posted the note, with some more hacks of the slapd.conf file (to be honest, when I posted the note, I was mistakenly editing the ldap.conf file ), I got around the "invalid credentials" error. I got it to the point where ldapadd was trying to load the tutorial.ldif file but errored out with something like "no attributes new or changed." My problem at this point is that I don't know enough about ldap to even see if there are any roots/databases in there that I can add the tutorial.ldif contents to as a subcontext, or enough to create an o=JNDITutorial root to work off (one or the other is necessary, according to the Preparations part of the JNDI Tutorial). Since my intention was to learn JNDI and not LDAP, I've burned enough time on this unless someone has successfully loaded the tutorial's tutorial.ldif file and can tell me how they did this. (A possible variable in my case is that I installed OpenLDAP as a set of Windows binaries pulled down from the Web, and I don't know if the initial database has any or different content from what one would get building the system from the OpenLDAP source [something no way now how I'm going to try to do!]).
I agree. Here's the link:
subject: JNDI Tutorial/LDAP examples/OpenLDAP
jQuery in Action, 3rd edition