Hello,
im trying to port my custom partition from 1.5.x to 2.0.0-M3.
Im getting a ClassNotFoundException when using
schemaManager.loadAllEnabled();
lang.ClassNotFoundException:
org.apache.directory.shared.ldap.schema.comparators.IntegerOrderingComparator
This class isnt in the jar, infact there is no packet "comperators" or even
"schema" in the jar at all.
Additionally - im trying to port this code:
private void initSchemaPartition()
throws Exception {
SchemaPartition schemaPartition =
service.getSchemaService().getSchemaPartition();
// Init the LdifPartition
LdifPartition ldifPartition = new LdifPartition();
String workingDirectory = service.getWorkingDirectory().getPath();
ldifPartition.setWorkingDirectory(workingDirectory + "/schema");
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File(workingDirectory, "schema");
SchemaLdifExtractor extractor =
new DefaultSchemaLdifExtractor(new File(workingDirectory));
extractor.extractOrCopy(true);
schemaPartition.setWrappedPartition(ldifPartition);
SchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
service.setSchemaManager(schemaManager);
// We have to load the schema now, otherwise we won't be able
// to initialize the Partitions, as we won't be able to parse
// and normalize their suffix DN
schemaManager.loadAllEnabled();
schemaPartition.setSchemaManager(schemaManager);
List<Throwable> errors = schemaManager.getErrors();
if (errors.size() != 0) {
throw new Exception("Schema load failed : " + errors);
}
}
i got as far as this but im not sure if this is correct (because of the class
not found exception) :
private void initSchemaPartition()
throws Exception {
String workingDir = workingDirectory.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File(workingDir, "schema");
SchemaLdifExtractor extractor =
new DefaultSchemaLdifExtractor(new File(workingDir));
extractor.extractOrCopy(true);
SchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
// Init the LdifPartition
LdifPartition ldifPartition = new LdifPartition(schemaManager);
service.setSchemaManager(schemaManager);
schemaManager.loadAllEnabled();
List<Throwable> errors = schemaManager.getErrors();
if (errors.size() != 0) {
throw new Exception("Schema load failed : " + errors);
}
}
Thanks for your assistance!