The returningObj property enables JNDI to decode JNDI References and Serializable objects stored in LDAP. Spring LDAP sets the flag mainly for getting the search result converted to a DirContext. I guess we should re-evaluate the need for this.
If you look at Sun's implementation of LdapContext, LdapCtx, you see that the search implementation adds all attributes in an array called Obj.JAVA_ATTRIBUTES, if the returningObjFlag is true:
Code:
1798 // if objects are requested then request the Java attributes too
1799 // so that the objects can be constructed
1800 if (cons.getReturningObjFlag()) {
1801 if (reqAttrs != null) {
1802
1803 // check for presence of "*" (user attributes wildcard)
1804 boolean hasWildcard = false;
1805 for (int i = reqAttrs.length - 1; i >= 0; i--) {
1806 if (reqAttrs[i].equals("*")) {
1807 hasWildcard = true;
1808 break;
1809 }
1810 }
1811 if (! hasWildcard) {
1812 String[] totalAttrs =
1813 new String[reqAttrs.length +Obj.JAVA_ATTRIBUTES.length];
1814 System.arraycopy(reqAttrs, 0, totalAttrs, 0,
1815 reqAttrs.length);
1816 System.arraycopy(Obj.JAVA_ATTRIBUTES, 0, totalAttrs,
1817 reqAttrs.length, Obj.JAVA_ATTRIBUTES.length);
1818
1819 cons.setReturningAttributes(totalAttrs);
1820 }
1821 }
1822 }
If we take a look at the Obj class, we see the following attributes:
Code:
65 // LDAP attributes used to support Java objects.
66 static final String[] JAVA_ATTRIBUTES = {
67 "objectClass",
68 "javaSerializedData",
69 "javaClassName",
70 "javaFactory",
71 "javaCodeBase",
72 "javaReferenceAddress",
73 "javaClassNames",
74 "javaRemoteLocation" // Deprecated
75 };
They map nicely to your list of unexpected attributes:
Code:
javaSerializedData javaClassName javaFactory javaCodebase javaReferenceAddress javaClassNames javaremotelocation