The implementation of javax.naming.Context.composeName( Name, Name) is wrong and return erroneous results. In following classes: - org.apache.naming.NamingContext - org.apache.naming.BaseDirContext - org.apache.naming.ProxyDirContext - org.apache.naming.SelectorContext The current implementation is: public Name composeName(Name name, Name prefix) throws NamingException { prefix = (Name) name.clone(); // here is the error return prefix.addAll(name); } So, on a Context ctx A call like ctx.composeName("foo/bar", "example/prefix") might return a Name like "example/prefix/foo/bar" but actually return "foo/bar/foo/bar" ! The correct implementation is: public Name composeName(Name name, Name prefix) throws NamingException { prefix = (Name) prefix.clone(); return prefix.addAll(name); }
I have applied to the fix to 4.1.x and 5.5.x Many thanks for the patch.