OID ldapadd Command Fails with Error ldap_add: Object class violation or ldap_add_s: Constraint violation

(Doc ID 1379627.1)

Last updated on OCTOBER 26, 2017

Applies to:

Oracle Internet Directory - Version 10.1.4.0.1 to 11.1.1 [Release 10gR3 to 11g]
Information in this document applies to any platform.

Symptoms

1.ldapadd command fails with below common error message.

  "ldap_add: Object class violation"

2.Examples of failed ldapadd commands

   Example 1:
   --------------
   >ldapadd -p 389 -h oid1.oracle.com -D "cn=orcladmin" -w **** -v -f testdomain.ldif
add dc:
testdomain
add objectclass:
domain
top
adding new entry dc=testdomain
ldap_add: Constraint violation
ldap_add: additional info: Admin domain does not contain schema information for objectclass domain.

Example 2:
--------------
>ldapadd -h oiddv1 -p 389 -D cn=orcladmin -w ***** -f file1.ldif
adding new entry cn=slbmtree,cn=OracleContext
ldap_add: Object class violation
ldap_add: additional info: dc attribute not found. Mandatory Attribute missing.

In this case it was OID 10.1.4.0.1.
But same note applies for later OID versions if above error is faced.

Changes

OID Schema ObjectClasses were not as per standard definition.

Here in this case we had two issues

1. "domain" objectclass was missing.

2."top" objectclass was modified unknowingly and was not as per standard default installation

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms