I am having problems creating a JNDI Resource lookup using iPlanet 7.0u15.

I created the following resource.



Resource Name: ldap/ldapsearch
Resource Type: javax.naming.ldap.LdapContext
Resource Factory Class: com.sun.jndi.ldap.LdapCtxFactory
External JNDI Name: ldapsearch

java.naming.security.principal=cn=Directory Manager


After I did this, I updated my web.xml with the following.

<description>DB Connection</description>

Then, I created a sun-web.xml (because everybody says I have to for iPlanet context lookup).


In my Java code, I do the following:

InitialContext searchctx = new InitialContext();
DirContext ctx = (javax.naming.ldap.LdapContext) searchctx.lookup("java:/comp/env/ldap/ldapsearch");

I check the logs and I see the following error:

LDAP: error code 34 - invalid DN

The resource in iPlanet is correct because I use the credentials from "LDAP Brower" windows application and I have used the credentials from the command-line using the CLI ldapsearch with no problems. What gives?

Anybody know what I am doing wrong here?!?