I downloaded the
J2EE server from sun. I created some EJB's, deployed them, everything's wonderful, fine.
The problem comes when I want to access the LDAP. First question, does the J2EE server from Sun even start an LDAP? I think it does because when you start the server with j2ee -verbose, one of the first lines is
Naming Service Started:1050
Sun's server is so poorly documented, I can't even tell, or if I want to install iPlanet or something, I wouldn't even know how to configure the server to point to that LDAP instead of its own. (I checked, there isn't any jndi.properites file that I can find)
Second question, how in the hell do I access it for
testing? I can't find any documentation on Sun's J2EE server anyplace that specifies how in the hell to access it.
I tried
Hashtable properties = new Hashtable();
properties.put(InitialContext.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
properties.put(InitialContext.PROVIDER_URL,"ldap://localhost:1050/o=myapp");
InitialContext context = new InitialContext (properties);
it throws a
javax.naming.CommunicationException: Request: 1 cancelled
at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:60)
at com.sun.jndi.ldap.Connection.readReply(Connection.java:405)
at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:340)
at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:171)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2640)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:290)
I'm running my client from Eclipse. Do I have to add something to the enviroment to get it to see it? Doesn't make sense, because if J2EE starts a Naming service on a port, I should just be able to connect to the port and get the information that way no?
I change the port to 389, and I get connection refused error.
I haven't done anything weird here, I just downloaded the standard Sun J2EE server, installed it, and am now trying to access the information in its naming service. Been staring at this for 2 days now, getting frustrated.
Thanks.