2010-02-25 7 views
1

glassfish 사용자 정의 자원에서 제공하는 속성을 사용하여 LDAP 연결을 얻으려고합니다.glassfish jndi 자원을 통한 활성 디렉토리 연결

내 JNDI 설정 :

Resourcetype: javax.naming.directory.Directory 
Factory-Class: com.sun.jndi.ldap.LdapCtxFactory 

Parameters: 
java.naming.security.credentials = myPassword 
java.naming.security.principal = cn=ldapUser,ou=myOrganization,dc=myDomain,dc=net 
URL = ldap://ldapserver/ou=myOrganization,dc=myDomain,dc=net 

이 내가 자바에서 연결 얻을 방법은 다음과 같습니다

Context initCtx = new InitialContext(); 
DirContext ctx = (DirContext) initCtx.lookup("CMDB2LDAP"); 

이 OpenLDAP를 완벽하게 작동하지만 내가 AD 2003에 연결하려고 할 때 내가 얻을를 다음 예외 :

javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece]; remaining name '' 

내 자신의 DirContext를 만들고 정확히 같은 속성을 그것은 연결이 완벽하게 작동합니다.

간편한 관리를 위해 glassfish에서 연결 설정을 얻는 것을 선호합니다.

답변

1

다른 속성으로 java.naming.referral = follow을 추가하고 작동하는지 확인해보십시오.