Dmitrii Bundin Dmitrii Bundin - 6 months ago 35
Java Question

apacheDS unable to create new entry

I'm using

Apache Directory Studio 2.0.0
and
ApacheDS 2.0
. After creating a new partition
o=SevenSeans,dc=com
, as said in http://directory.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html i'm trying to create a new entry. I select objectClass
organizationalPerson
and type parent
o=SevenSeans,dc=com
, RDN
uid=Name
. Then i click next and type value of
cn
and
sn
attributes. Now i click finish and have exception:

Error while creating entry
- [LDAP: error code 65 - OBJECT_CLASS_VIOLATION: failed for MessageType : ADD_REQUES
javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - OBJECT_CLASS_VIOLATION: failed for MessageType : ADD_REQUEST
Message ID : 19
Add Request :
Entry
dn[n]: uid=Name,o=SevenSeans,dc=com
objectclass: domain
objectclass: top
objectclass: extensibleObject
objectclass: organizationalPerson
objectclass: person
uid: Name
dc: SevenSeans
sn: sf
cn: s
: ERR_61 Entry uid=Name,o=SevenSeans,dc=com contains more than one STRUCTURAL ObjectClass: [OBJECT_CLASS ( 0.9.2342.19200300.100.4.13
NAME 'domain'
SUP 'top'
STRUCTURAL
MUST 'dc'
MAY ( 'associatedName' $ 'o' $ 'description' $ 'businessCategory' $ 'seeAlso' $ 'searchGuide' $ 'userPassword' $ 'l' $ 'st' $ 'street' $ 'physicalDeliveryOfficeName' $ 'postalAddress' $ 'postalCode' $ 'postOfficeBox' $ 'facsimileTelephoneNumber' $ 'internationaliSDNNumber' $ 'telephoneNumber' $ 'teletexTerminalIdentifier' $ 'telexNumber' $ 'preferredDeliveryMethod' $ 'destinationIndicator' $ 'registeredAddress' $ 'x121Address' )
)
, OBJECT_CLASS ( 2.5.6.7
NAME 'organizationalPerson'
DESC RFC2256: an organizational person
SUP 'person'
STRUCTURAL
MAY ( 'title' $ 'x121Address' $ 'registeredAddress' $ 'destinationIndicator' $ 'preferredDeliveryMethod' $ 'telexNumber' $ 'teletexTerminalIdentifier' $ 'telephoneNumber' $ 'internationaliSDNNumber' $ 'facsimileTelephoneNumber' $ 'street' $ 'postOfficeBox' $ 'postalCode' $ 'postalAddress' $ 'physicalDeliveryOfficeName' $ 'ou' $ 'st' $ 'l' )
)
]]; remaining name 'uid=Name,o=SevenSeans,dc=com'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(Unknown Source)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper$4.run(JNDIConnectionWrapper.java:669)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.runAndMonitor(JNDIConnectionWrapper.java:1305)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.checkConnectionAndRunAndMonitor(JNDIConnectionWrapper.java:1237)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.createEntry(JNDIConnectionWrapper.java:722)
at org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryRunnable.createEntry(CreateEntryRunnable.java:224)
at org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryRunnable.run(CreateEntryRunnable.java:124)
at org.apache.directory.studio.connection.ui.RunnableContextRunner$1.run(RunnableContextRunner.java:112)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

[LDAP: error code 65 - OBJECT_CLASS_VIOLATION: failed for MessageType : ADD_REQUEST
Message ID : 19
Add Request :
Entry
dn[n]: uid=Name,o=SevenSeans,dc=com
objectclass: domain
objectclass: top
objectclass: extensibleObject
objectclass: organizationalPerson
objectclass: person
uid: Name
dc: SevenSeans
sn: sf
cn: s
: ERR_61 Entry uid=Name,o=SevenSeans,dc=com contains more than one STRUCTURAL ObjectClass: [OBJECT_CLASS ( 0.9.2342.19200300.100.4.13
NAME 'domain'
SUP 'top'
STRUCTURAL
MUST 'dc'
MAY ( 'associatedName' $ 'o' $ 'description' $ 'businessCategory' $ 'seeAlso' $ 'searchGuide' $ 'userPassword' $ 'l' $ 'st' $ 'street' $ 'physicalDeliveryOfficeName' $ 'postalAddress' $ 'postalCode' $ 'postOfficeBox' $ 'facsimileTelephoneNumber' $ 'internationaliSDNNumber' $ 'telephoneNumber' $ 'teletexTerminalIdentifier' $ 'telexNumber' $ 'preferredDeliveryMethod' $ 'destinationIndicator' $ 'registeredAddress' $ 'x121Address' )
)
, OBJECT_CLASS ( 2.5.6.7
NAME 'organizationalPerson'
DESC RFC2256: an organizational person
SUP 'person'
STRUCTURAL
MAY ( 'title' $ 'x121Address' $ 'registeredAddress' $ 'destinationIndicator' $ 'preferredDeliveryMethod' $ 'telexNumber' $ 'teletexTerminalIdentifier' $ 'telephoneNumber' $ 'internationaliSDNNumber' $ 'facsimileTelephoneNumber' $ 'street' $ 'postOfficeBox' $ 'postalCode' $ 'postalAddress' $ 'physicalDeliveryOfficeName' $ 'ou' $ 'st' $ 'l' )
)
]]


If i use
import->LDIF
and choose
captain-hook-hierarchy.ldif


Error while importing LDIF
- [LDAP: error code 32 - NO_SUCH_OBJECT: failed for MessageType : ADD_REQUES
javax.naming.NameNotFoundException: [LDAP: error code 32 - NO_SUCH_OBJECT: failed for MessageType : ADD_REQUEST
Message ID : 20
Add Request :
Entry
dn[n]: ou=people,o=sevenSeas
objectclass: organizationalUnit
objectclass: top
ou: people
: ERR_268 Cannot find a partition for ou=people,o=sevenSeas]; remaining name 'ou=people,o=sevenSeas'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(Unknown Source)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper$4.run(JNDIConnectionWrapper.java:669)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.runAndMonitor(JNDIConnectionWrapper.java:1305)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.checkConnectionAndRunAndMonitor(JNDIConnectionWrapper.java:1237)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.createEntry(JNDIConnectionWrapper.java:722)
at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifRunnable.importLdifRecord(ImportLdifRunnable.java:464)
at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifRunnable.importLdif(ImportLdifRunnable.java:272)
at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifRunnable.run(ImportLdifRunnable.java:218)
at org.apache.directory.studio.connection.core.jobs.StudioConnectionJob.run(StudioConnectionJob.java:109)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

[LDAP: error code 32 - NO_SUCH_OBJECT: failed for MessageType : ADD_REQUEST
Message ID : 20
Add Request :
Entry
dn[n]: ou=people,o=sevenSeas
objectclass: organizationalUnit
objectclass: top
ou: people
: ERR_268 Cannot find a partition for ou=people,o=sevenSeas]


How do I fix this? It's ok to create new entry if i choose
top
class.

Answer

There are a number of issues with that tutorial(spelling, UI looks different, etc) but i have managed to import the sample data and add a new entry.

your error occurs for this reason: com contains more than one STRUCTURAL ObjectClass. this is occurring because domain and organizationalPerson are both structural and will not work together, try removing domain. For more info, see LDAP objectClasses

To import the captain-hook-hierarchy.ldif you need to create a new partition first. The tutorial is inconsistent with naming conventions and is the cause of your error. Create a new partition:

ID:SevenSeas
Suffix: o=sevenSeas

The error you get is because of the ,dc=com from the tutorial. if you open the .ldif you'll see there is no reference to ,dc=com.

Next uncheck the Auto-generate context entry from suffix DN checkbox. it doesnt create the appropriate attributes for the example. Then add these attributes:

o: sevenSeas
objectClass: top
objectClass: organization
description: The context entry for suffix o=sevenSeas

Save the config.ldif file and restart the server. Then import captain-hook-hierarchy.ldif. The directory should populate and to add new entries just right-click on a group and Add new entry.

Hope this helps!

Comments