0

We are using Novel Ldap Api for all LDAP operations, i want to load my base schema ldif file to opendj without restarting the openDJ server.

So far, post setup we are manually copying the schema file to /config/schema location and we wanted it to do through Java code.

Since we already using Novel Ldap for all LDAP operations (modify, delete, read, add entry), we have to use the same. When i tried, iam getting below exception, is there any solution please share?

SEVERE: Exception getting LDAP connection: LDAPLocalException: com.novell.ldap.ldif_dsml.LDIFReader: Version line must be the first meaningful line(on line 9 of the file) (82) Local Error at com.novell.ldap.util.LDIFReader.(LDIFReader.java:156) at com.novell.ldap.util.LDIFReader.(LDIFReader.java:80)

Vijay
  • 1,026
  • 3
  • 11
  • 28
  • Without knowing your LDIF data I can only guess. But the error message seems to indicate that your LDIF files does not start with `version:` line. – Michael Ströder Mar 29 '19 at 16:30

1 Answers1

0

It looks like the Novell LDIF reader is strictly accepting LDIF version 1 from RFC 2849. The first line should contain version: 1 OpenDJ does support adding schema over LDAP, it must be a change of cn=schema, adding values to the attributeTypes and objectClasses attributes.

Ludovic Poitou
  • 4,788
  • 2
  • 21
  • 30
  • Thanks for the details, you mean we can't add schema ldif file using Novell LDAP Api, but schema with changetype: modify should be fine. is n't it? – Vijay Apr 03 '19 at 09:21
  • through changeType:modify, i added attributeTypes and objectClasses. Now it looks to be unable to load other ldif files due to an exception violates the Directory Server schema configuration because it does not include a structural objectclass. All entries must contain a structural objectclass – Vijay Apr 03 '19 at 09:33
  • The schema and the entries must be compliant with the LDAP specifications. There are options in OpenDJ to relax some of those constraints, but that may result in unpredictive behaviors, and interoperability issues with specific client applications. – Ludovic Poitou Apr 05 '19 at 08:47
  • Thank you for the details, incorporated 'version' details to ldif file. Then able to load the ldif file using LDAPModifyRequest. – Vijay Apr 05 '19 at 11:44