Hope this blog helps anyone looking at running through Sun/Oracle JNDI tutorials. I had to troubleshot to get the samples running and hence putting this blog to help anyone in similar situation. I was running the samples on ApacehDS LDAP server, hence had to make few changes before the tutorial.ldif loaded correctly. Below is the exact steps I had to follow to make it work.
- Download and install ApacheDS, at time of this writing latest available is 2.0.0-m16
- Download and install Apache Directory Studio (ADS)
- Follow below steps to connect ADS to ApacheDS server
Create a new LDAP connection (see below screenshot)
Enter following default credentials uid=admin,ou=system/secret
Click on “Check Authentication”, if it returns successful ADS is now connected to ApacheDS.
- Make the necessary changes to tutorials.ldif so that it loads into the ApacheDS.
A partition is a logical grouping of things in a ApacehDS. The above mentioned file expects to be loaded into a separate partition. The changes that are being made below affects how partition is created in ApacheDS.
Make the following changes in entire file
From : dn: o=JNDITutorial To : dn: o=JNDITutorial,dc=example,dc=com
Add the “dc” object to first block, see below
dn: o=JNDITutorial,dc=example,dc=com o: JNDITutorial dc: example objectclass: top objectclass: organization objectclass: dcObject
You can download the rightly modified file [here]
- Create a partition on ApacheDS to load the file. Follow below steps on ADS
- Open configurations by right clicking on the target LDAP connection
- Click on the tab “Partitions” (see bottom of above screenshot)
- Click “Add” on the “Partitions” tab and fill details as show below
Important bit is Suffix and it has to match what you choose in step 4. - Save the configurations and restart ApacheDS and reconnect ADS to load newly added partition.
- Once above steps are complete, you can right click on any node on the “LDAP Browser” window on ADS and import the file tutorials.ldif
Hopefully above steps will get you on track to completing the JNDI tutorial.