Hello,

I’m interested in running ApacheDS as an embedded process within Apache 
Fortress Rest component, which deploys as a .war file inside Apache Tomcat (and 
other servlet containers).

The idea here is to provide a stand-alone capability for users to test, develop 
with.  Later, when they move to production, it would instead point to an 
external directory, replicated, backed up, etc.

So, my first step is to run this junit test suite inside fortress core:

https://github.com/apache/directory-fortress-core/blob/master/src/test/java/org/apache/directory/fortress/core/impl/apacheds/FortressJUnitApachedsTest.java

Which uses this to initialize the embedded server:


@RunWith(FrameworkRunner.class)
@CreateDS(name = "classDS", partitions =
{ @CreatePartition(name = "example", suffix = "dc=example,dc=com") })
@CreateLdapServer(
transports =
{
@CreateTransport(protocol = "LDAP", port = 10389)
})
@ApplyLdifFiles(
{ "fortress-schema.ldif", "init-ldap.ldif"/*, "test-data.ldif"*/})

The LDIF files referenced here exist here:
https://github.com/apache/directory-fortress-core/tree/master/src/test/resources

When I execute the test case, this exception below.

Any clues on what could be going wrong?

*** Here are the versions:
<version.apacheds>2.0.0.AM25</version.apacheds>
<version.api.all>1.0.2</version.api.all>

*** The Exception:
2018-12-04 07:40:046 INFO  CacheService:131 - no custom cache configuration was 
set, loading the default cache configuration
2018-12-04 07:40:046 INFO  DefaultSchemaLdifExtractor:110 - Schema directory 
'/tmp/server-work-classDS/partitions/schema' does NOT exist: extracted state 
set to false.

org.apache.directory.api.ldap.schema.extractor.UniqueResourceException: Problem 
locating LDIF file in schema repository
Multiple copies of resource named 
'schema/ou=schema/cn=apachedns/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.2.3.9.ldif'
 located on classpath at urls
    
jar:file:/home/smckinn/.m2/repository/org/apache/directory/api/api-all/1.0.2/api-all-1.0.2.jar!/schema/ou%3dschema/cn%3dapachedns/ou%3dobjectclasses/m-oid%3d1.3.6.1.4.1.18060.0.4.2.3.9.ldif
    
jar:file:/home/smckinn/.m2/repository/org/apache/directory/api/api-ldap-schema-data/2.0.0.AM1/api-ldap-schema-data-2.0.0.AM1.jar!/schema/ou%3dschema/cn%3dapachedns/ou%3dobjectclasses/m-oid%3d1.3.6.1.4.1.18060.0.4.2.3.9.ldif
        at 
org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor.getUniqueResource(DefaultSchemaLdifExtractor.java:366)
        at 
org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor.getUniqueResourceAsStream(DefaultSchemaLdifExtractor.java:343)
        at 
org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor.extractFromClassLoader(DefaultSchemaLdifExtractor.java:381)
        at 
org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor.extractOrCopy(DefaultSchemaLdifExtractor.java:169)
        at 
org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor.extractOrCopy(DefaultSchemaLdifExtractor.java:190)
        at 
org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory.initSchema(DefaultDirectoryServiceFactory.java:172)
        at 
org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory.build(DefaultDirectoryServiceFactory.java:256)
        at 
org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory.init(DefaultDirectoryServiceFactory.java:125)
        at 
org.apache.directory.server.core.factory.DSAnnotationProcessor.createDS(DSAnnotationProcessor.java:100)
        at 
org.apache.directory.server.core.factory.DSAnnotationProcessor.getDirectoryService(DSAnnotationProcessor.java:333)
        at 
org.apache.directory.server.core.integ.FrameworkRunner.run(FrameworkRunner.java:112)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
        at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
        at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

2018-12-04 07:40:046 ERROR FrameworkRunner:196 - ERR_181 Failed to run the 
class org.apache.directory.fortress.core.impl.apacheds.FortressJUnitApachedsTest
2018-12-04 07:40:046 ERROR FrameworkRunner:197 - Problem locating LDIF file in 
schema repository
Multiple copies of resource

Shawn





Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to