When adding custom LDAP schemas to the ldifFile attribute for embedded server there is no way to enable built in schemas that are not enabled by default.
For example, custom object class definition has defined mandatory attribute homeDirectory.
Attribute homeDirectory is provided in ApacheDS 1.5.5 within nis schema with definition:
dn: m-oid=1.3.6.1.1.1.1.3,ou=attributeTypes,cn=nis,ou=schema
objectClass: metaAttributeType
objectClass: metaTop
objectClass: top
m-oid: 1.3.6.1.1.1.1.3
m-collective: FALSE
m-description: The absolute path to the home directory
m-equality: caseExactIA5Match
m-name: homeDirectory
m-noUserModification: FALSE
m-obsolete: FALSE
m-singleValue: TRUE
m-syntax: 1.3.6.1.4.1.1466.115.121.1.26
m-usage: USER_APPLICATIONS
Before any LDAP entry can use that attribute, or before custom object class can be created, it is necessary to enable nis schema (provided with ApacheDS, but disabled by default).
In order to enable nis schema main ldif should have
dn: cn=nis,ou=schema
changetype: modify
replace: m-disabled
m-disabled: FALSE
Since org.springframework.ldap.ldif.parser.LdifParser doesn't support change operations suggested code change provided in gist would solve the problem far simpler then changing LdifParser.
Patch file provided as well, documentation should be updated
Migrated from LDAP-307
When adding custom LDAP schemas to the ldifFile attribute for embedded server there is no way to enable built in schemas that are not enabled by default.
For example, custom object class definition has defined mandatory attribute homeDirectory.
dn: m-oid=1.3.6.1.4.1.90009.99.1.1, ou=objectclasses, cn=example, ou=schema objectclass: metaObjectClass objectclass: metaTop objectclass: top m-oid: 1.3.6.1.4.1.90009.99.1.1 m-name: customObjectClass m-supObjectClass: inetOrgPerson m-typeObjectClass: STRUCTURAL m-must: cn m-must: sn m-must: uid m-must: mail m-must: userPassword m-must: homeDirectory
Attribute homeDirectory is provided in ApacheDS 1.5.5 within nis schema with definition: dn: m-oid=1.3.6.1.1.1.1.3,ou=attributeTypes,cn=nis,ou=schema objectClass: metaAttributeType objectClass: metaTop objectClass: top m-oid: 1.3.6.1.1.1.1.3 m-collective: FALSE m-description: The absolute path to the home directory m-equality: caseExactIA5Match m-name: homeDirectory m-noUserModification: FALSE m-obsolete: FALSE m-singleValue: TRUE m-syntax: 1.3.6.1.4.1.1466.115.121.1.26 m-usage: USER_APPLICATIONS
Before any LDAP entry can use that attribute, or before custom object class can be created, it is necessary to enable nis schema (provided with ApacheDS, but disabled by default).
In order to enable nis schema main ldif should have dn: cn=nis,ou=schema changetype: modify replace: m-disabled m-disabled: FALSE
Since org.springframework.ldap.ldif.parser.LdifParser doesn't support change operations suggested code change provided in gist would solve the problem far simpler then changing LdifParser.
Patch file provided as well, documentation should be updated