aliasAttrs.put( "cn", "alias" );
aliasAttrs.put( "aliasedObjectName", "cn=real,ou=sales,ou=system" );
ctx.createSubcontext( "cn=alias,ou=engineering", aliasAttrs );
// Delete the real entry first
ctx.destroySubcontext( "cn=real,ou=sales" );
// Now the alias entry still exists, but points to nowhere.
// When trying to delete the alias entry an exception occurs.
ctx.destroySubcontext( "cn=alias,ou=engineering" );
}