users@glassfish.java.net

Looking up for a custom/external resource.

From: <glassfish_at_javadesktop.org>
Date: Fri, 26 Jun 2009 07:18:46 PDT

Guys I have the following problem. I want to configure a LdapContext as a custom or external resource in my Glassfish v2.1. When I configure it as a custom JNDI resource I can see it in my JNDI Browser but I can't access it from any application running on this glassfish:

@Resource(name="ldap/ad") private LdapContext ctx; // Just gives me a NamingException.

When I try to configure it as an external JNDI resource I even can't see it in my JNDI Browser.
As problems never arrive alone, I have to use this LdapContext from a custom realm.

I'm using this parameter to configure my JNDI resource:
CUSTOM JNDI RESOURCE:
name => ldap/ad
type => javax.naming.ldap.LdapContext
factory class => com.sun.jndi.ldap.LdapCtxFactory

EXTERNAL JNDI RESOURCE:
name => ldap/ad
type => javax.naming.ldap.LdapContext
factory class => com.sun.jndi.ldap.LdapCtxFactory
jndi lookup => my base DN

PROPERTIES (used in both configurations):
java.provider.url => my Ldap server url
java.security.auth => simple
java.security.principal => some user CN
java.security.credentials => password of the given user

I'm using MS Active Directory as my LDAP server and this are the same configuration I used to create a LdapContext by hand.

I don't know, I'm probably missing some configuration, it was a week since I started trying to make it work but I wasn't abble.
[Message sent by forum member 'yellowbike' (yellowbike)]

http://forums.java.net/jive/thread.jspa?messageID=353161