Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java EE (J2EE) и Spring > ошибка при доступе к Active Directory


Автор: vzf 4.5.2007, 14:33
Здравствуйте. Моя программа пытается получить атрибут LDAP supportedSASLMechanisms. Если в качестве LDAP сервера использовать сервер от Tivoly, то все нормально. Но если вместо него использовать Active Directory то выбрасывается исключение. В чем здесь ошибка?

Вот код
Код


String urlDC = "ldap://" + host + "." + domain + ":" + port + "/";
        Hashtable ldapEnv = new Hashtable();

        // getting supported SASL Mechanism for the authentication
        LdapContext ctx = new InitialLdapContext();
        Enumeration enumeration = ctx.getAttributes(urlDC, new String[]
        { "supportedSASLMechanisms" }).getAll();


Вот эксепшн

Код

javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C09

0627, comment: In order to perform this operation a successful bind must be comp

leted on the connection., data 0, vece ]; remaining name ''

        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3025)

        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2931)

        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2737)

        at com.sun.jndi.ldap.LdapCtx.c_getAttributes(LdapCtx.java:1291)

        at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(Componen

tDirContext.java:213)

        at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Par

tialCompositeDirContext.java:121)

        at com.sun.jndi.toolkit.url.GenericURLDirContext.getAttributes(GenericUR

LDirContext.java:85)

        at com.sun.jndi.url.ldap.ldapURLContext.getAttributes(ldapURLContext.jav

a:295)

        at javax.naming.directory.InitialDirContext.getAttributes(InitialDirCont

ext.java:123)

.....


Валится на строчке

Код

Enumeration enumeration = ctx.getAttributes(urlDC, new String[]
        { "supportedSASLMechanisms" }).getAll();


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)