#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    1
    Rep Power
    0

    Question Adding entries on jndi


    Hi all,


    i was able to add entires successfully, using an entries.ldif file whith the same dn's slapadd. But I'm trying to add entries using jndi through

    after creatting my attributes collection and put it in the ats object i write and connected successfully:

    String dn = "cn=fernando,ou=agentes,ou=lab,dc=hospital,dc=imss"

    Context res = ctx.createSubContext(dn, ats);


    and i get the following exception:

    javax.naming.directory.InvalidAttributeIdentifierException: [LDAP: error code 17 - dn: attribute type undefined]; remaining name 'cn=fernando, ou=agentes, ou=lab, dc=hospital, dc=imss'
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3057)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2934)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2740)
    at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:777)
    at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319)

    believe me i tried a lot of combinations for the dn:

    "dn:cn=fernando,ou=agentes,ou=lab,dc=hospital,dc=imss"
    "cn=fernando"
    "dc=hospital,dc=imss"
    "cn=fernando,dc=hospital,dc=imss"


    is there are better examples that can help me out with this one?

    Thanks.
    Attached Images
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Stuttgart
    Posts
    50
    Rep Power
    11
    "dn:cn=fernando,ou=agentes,ou=lab,dc=hospital,dc=imss"
    "cn=fernando"
    "dc=hospital,dc=imss"
    "cn=fernando,dc=hospital,dc=imss"
    Use: "dc=hospital,dc=imss,ou=lab,ou=agentes,cn=fernando"

    The DN is always starting with the root-dn.


    But i think your problem is not the dn;
    attribute type undefined
    means, that you're trying to write attributes that aren't allowed in the LDAP schema. Check your code for typing-mistakes..

IMN logo majestic logo threadwatch logo seochat tools logo