Hope this blog helps anyone looking at running through Sun/Oracle JNDI tutorials. I had to troubleshoot to get the samples running, and hence putting this blog to help anyone in a similar situation. I was running the samples on the ApacheDS LDAP server, hence I had to make a few changes before the tutorial.ldif loaded correctly. Below are the exact steps I had to follow to make it work.
- Download and install ApacheDS; at the time of this writing, the latest available is 2.0.0-m16
- Download and install Apache Directory Studio (ADS)
- Follow the steps below to connect ADS to the ApacheDS server
-
Create a new LDAP connection (see screenshot below)
-
Enter the 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 an ApacheDS. The above-mentioned file is expected to be loaded into a separate partition. The changes that are being made below affect how the partition is created in ApacheDS.
- Make the following changes in the entire file
From : dn: o=JNDITutorial
To : dn: o=JNDITutorial,dc=example,dc=com
- Add the “dc” object to the 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 modified file [here][4]
- Create a partition on ApacheDS to load the file. Follow the steps below 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 shown below
Important bit is the Suffix, and it has to match what you choose in step 4.
- Save the configurations and restart ApacheDS and reconnect ADS to load the newly added partition.
- Once the 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.