Thanks. I can reproduce an error with your example code, at least with ApacheDS 1.0 RC4. It causes a ClassCastException in the interceptor chain. Currently I write a JUnit test in order to re-check with the current 1.0 snapshot.

Stay tuned.

Greetings, Stefan

---8<---

Stefan Zoerner ([EMAIL PROTECTED])
Apache Directory Project
Committer :: PMC Member

Mbah Tenjoh-Okwen wrote:
Thanks
here is the relevant part of the code:

           //create context
            DirContext ctx=new InitialDirContext(properties);
//create entry attributes
            Attributes attrs= new BasicAttributes(true);
            Attribute attr= new BasicAttribute("objectClass", "alias");
Attribute attr1= new BasicAttribute("aliasedObjectName", "ou=favorite,ou=Fruits,ou=system");
            attrs.put (attr);
            attrs.put(attr1);
// create the string to contain rdns
            String rdns ="ou=bestFruit,ou=Fruits";
//create the subentry
            ctx.createSubcontext(rdns, attrs);
Here is the stack trace I got:

javax.naming.NamingException: [LDAP: error code 80 - failed to add entry ou=bestFruittt,ou=Fruits,ou=system: Unexpected exception.]; remaining name 'ou=bestFruittt,ou=Fruits'
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3029)
    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_createSubcontext(LdapCtx.java:770)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext (PartialCompositeDirContext.java:248) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java :236) at javax.naming.directory.InitialDirContext.createSubcontext(InitialDirContext.java:178)
    at binds.BindAlias.main(BindAlias.java:45)

A word about the code.
If I replace "alias" with another objectClass- say "top" the code runs without errors.


thanks


On 9/30/06, *Stefan Zoerner (JIRA)* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

        [
    
http://issues.apache.org/jira/browse/DIRSERVER-752?page=comments#action_12438885
    ]

    Stefan Zoerner commented on DIRSERVER-752:
    ------------------------------------------

    The information the reporter provieded is not sufficient to help. At
    least a JNDI source code fragment is needed (what exactly has been
    tried to create an alias), and a stack trace would be helpful as well.

    ApacheDS does support alias entries, btw.

     > Alias Problem
     > -------------
     >
     >                 Key: DIRSERVER-752
     >                 URL:
    http://issues.apache.org/jira/browse/DIRSERVER-752
     >             Project: Directory ApacheDS
     >          Issue Type: Bug
     >         Environment: windows XP
     >            Reporter: mbah tenjoh-okwen
     >
     >     hello
     >      I would like to know if apacheDS supports aliasing and if so
    what do I need to do in other to add a
     >     sub context of object class type "alias". Each time I try to
    add one I  get an error report. I use JNDI and so the error i get is
    of type   javax.naming.NamingException .
     >     I will appreciate your help
     >     thanks

    --
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the
    administrators: http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira
    <http://www.atlassian.com/software/jira>





--

Reply via email to