users@glassfish.java.net

Custom JNDI

From: <forums_at_java.net>
Date: Wed, 12 Sep 2012 06:35:57 -0500 (CDT)

Dear Members, I try to create a custom-resource to be able to connect to a
LDAP. In GF3.1.2.2 Web admin, I create a custom-resource called jndi/ldap
resourceType=javax.naming.directory.Directory
factory-class=com.sun.jndi.ldap.LdapCtxFactory I add the following
properties: SECURITY_AUTHENTICATION=simple SECURITY_PRINCIPAL=myldapuser
SECURITY_CREDENTIALS=myldappassword URL=ldap://myldap:3268 then in my
managedBean, i do the following: i have a method that connects to the ldap. I
first create the DirContext Context initCtx = new InitialContext();
DirContext ctx = (DirContext) initCtx.lookup("jndi/ldap"); When I debug, I
see that theenvProp of ctx only contains the URL property all others are not
loaded. Do I miss someting ? Thanks for your help.

--
[Message sent by forum member 'paulolambert']
View Post: http://forums.java.net/node/890171