java-8opendjnovell

Can we load Schema (base schema) for OpenDJ using Novel Ldap api?


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)


Solution

  • 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.