directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdemic <>
Subject ClassCastException in rename()
Date Sun, 30 Sep 2007 21:39:22 GMT

Hey All,

I'm encountering a ClassCastException in the rename() method of
ServerContext. I'm not sure if I'm doing something wrong, but the code works
with OpenLDAP but not with ApacheDS.  Here's the relevant lines from

 public void rename( Name oldName, Name newName ) throws NamingException
        LdapDN oldDn = buildTarget( oldName );
        LdapDN newDn = buildTarget( newName );
        if ( oldDn.size() == 0 )
            throw new LdapNoPermissionException( "can't rename the rootDSE"

        // calculate parents
        LdapDN oldBase = ( LdapDN ) oldName.clone();  <<<<

My client code is passing in objects.  I could be
mistaken, but it seems like the clone() should be on oldDn and not oldName. 

Any help is appreciated,
View this message in context:
Sent from the Apache Directory Project mailing list archive at

View raw message