user2953119
user2953119

Reputation:

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.

Upvotes: 9

Views: 21770

Answers (4)

GSAN
GSAN

Reputation: 668

The last versión of Apache Directory Studio (Version: 2.0.0.v20151221-M10) has a bug, a missing newline between the generated LDIF records: https://issues.apache.org/jira/browse/DIRSTUDIO-1080

Very easy to fix it, just download a new versión fixed: https://builds.apache.org/job/dir-studio/

Upvotes: 1

I can't comment, so...

Sionnach733 : you can't have 2 structural ObjectClass in an entry, except if they have an inheritance relation. For instance, OrganizationalPerson inherits from Person, so you can have both in an entry (even if adding OrganizationalPerson only implies that person is also implicitely added in the entry).

And, yes, those rules are a bit stupid...

Upvotes: 1

I have fixed the tutorial (http://directory.staging.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html for anyone who want to see the changes before the real site on http://directory.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html is on line - that will take a couple of hours).

Thanks for report ! It would be even more convenient to create a JIRA with a description of the typoes (and a patch is even better ! The web site is text based (markdown) and available on http://svn.apache.org/repos/asf/directory/site/trunk/content/)

Upvotes: 0

Sionnach733
Sionnach733

Reputation: 4736

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!

Upvotes: 15

Related Questions