not able to call OpenDJ REST service using sample scriptedrest2dj

This topic has 1 reply, 2 voices, and was last updated 6 years, 5 months ago by Rajesh R.

  • Author
    Posts
  • #7480
     praveenalla
    Participant

    I am trying to run the sample scriptedrest2dj and did all the steps of installing OpenDJ locally and importing the ldif file ldap.ldif

    The import of ldap.ldif is not getting successful result which is making my other steps of calling Open DJ REST services fail.

    Below is the error I see in OpenDJ error log when I try to import ldap.ldif file provided in the sample with OpenIDM 4.0.0

    I am using OpenDJ 2.6.0 for testing. Can some one help with running of this sample as we need to run a REST service as part of our POC using the OpenIDM software.

    ldap.ldif contents:

    dn: dc=example,dc=com
    changetype: add
    objectClass: domain
    objectClass: top
    dc: example
    aci: (targetattr=”*”)(version 3.0; acl “IDM Access”; allow (all)
    userdn=”ldap:///uid=idm,ou=Administrators,dc=example,dc=com”;)

    dn: ou=Administrators, dc=example,dc=com
    changetype: add
    objectclass: top
    objectclass: organizationalunit
    ou: Administrators

    dn: uid=idm, ou=Administrators,dc=example,dc=com
    changetype: add
    objectclass: top
    objectclass: person
    objectclass: organizationalPerson
    objectclass: inetOrgPerson
    uid: idm
    cn: IDM Administrator
    sn: IDM Administrator
    description: Special LDAP acccount used by openIDM
    ou: Administrators
    userPassword: password
    ds-privilege-name: bypass-acl
    ds-privilege-name: changelog-read

    dn: ou=People,dc=example,dc=com
    changetype: add
    ou: people
    description: people
    objectclass: organizationalunit

    dn: ou=Groups,dc=example,dc=com
    changetype: add
    ou: Groups
    objectClass: organizationalUnit
    objectClass: top

    error in errors file from OpenDJ2.6.0/opendj/logs folder:

    [02/Feb/2016:15:48:31 -0800] category=JEB severity=NOTICE msgID=8847533 msg=OpenDJ 2.6.0 starting import (build 20130626200626Z, R9086)
    [02/Feb/2016:15:48:31 -0800] category=JEB severity=NOTICE msgID=8847449 msg=Import Thread Count: 16 threads
    [02/Feb/2016:15:48:31 -0800] category=JEB severity=NOTICE msgID=8847569 msg=Total import time was 0 seconds. Phase one processing completed in 0 seconds, phase two processing completed in 0 seconds
    [02/Feb/2016:15:48:31 -0800] category=JEB severity=NOTICE msgID=8847454 msg=Processed 5 entries, imported 0, skipped 0, rejected 5 and migrated 0 in 0 seconds (average rate 41.7/sec)
    [02/Feb/2016:15:48:31 -0800] category=JEB severity=NOTICE msgID=8847536 msg=Import LDIF environment close took 0 seconds
    [02/Feb/2016:15:48:32 -0800] category=JEB severity=NOTICE msgID=8847402 msg=The database backend userRoot containing 0 entries has started
    [02/Feb/2016:15:48:32 -0800] category=BACKEND severity=NOTICE msgID=9896350 msg=Import task 20160202154831112 finished execution

    Thanks,
    Praveen

    • This topic was modified 6 years, 5 months ago by Peter Major.
    #7481
     Rajesh R
    Participant

    @praveenalla Assuming that you created a base dn “dc=example,dc=com” and left it empty during the configuration (using ‘setup’) of OpenDJ, please run the following command pointing to the ldif file that I’ve pasted towards the end of this post:

    ==Command==
    import-ldif –port 4444 –hostname opendj.mydomain.com –bindDN “cn=Directory Manager” –bindPassword cangetindj –includeBranch dc=example,dc=com –replaceExisting –ldifFile /opt/Example.ldif –trustAll
    ==Command==

    ==LDIF File==
    dn: dc=com
    objectClass: domain
    objectClass: top
    dc:com

    dn: dc=example,dc=com
    objectClass: domain
    objectClass: top
    dc: example
    aci: (targetattr=”*”)(version 3.0; acl “IDM Access”; allow(all) userdn=”ldap://uid=idm,ou=Administrators,dc=example,dc=com”;)

    dn: ou=Administrators, dc=example,dc=com
    objectclass: top
    objectclass: organizationalunit
    ou: Administrators

    dn: uid=idm, ou=Administrators,dc=example,dc=com
    objectclass: top
    objectclass: person
    objectclass: organizationalPerson
    objectclass: inetOrgPerson
    uid: idm
    cn: IDM Administrator
    sn: IDM Administrator
    description: Special LDAP acccount used by openIDM
    ou: Administrators
    userPassword: password
    ds-privilege-name: bypass-acl
    ds-privilege-name: changelog-read

    dn: ou=People,dc=example,dc=com
    ou: people
    description: people
    objectclass: organizationalunit

    dn: ou=Groups,dc=example,dc=com
    ou: Groups
    objectClass: organizationalUnit
    objectClass: top
    ==LDIF==

    Note: If you copy and paste the information above, make sure you have the LDIF syntax correct. If the import operation fails, check the error log, which might give an indication of a possible syntax error in your ldif. I’ve tested the file above, and the import went through fine, but in the process of copying and pasting it, the entries might jumble, causing an import error. Be cautious of that.

    Hope it helps.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?