hi Mark,

After my own attempt to add a new schema it was observed that the registries are getting reset in the DefaultDirectoryService.initialize() (lines 1377-1380) as part of the DefaultDirectoryService.startup() call in
    AbstractServerTest.setUp().

The schemas are getting loaded through a prebuilt partition 'apacheds-schema-bootstrap' so the way I fixed this was by adding an entry in the pom.xml and built a local version of apacheds-schema-bootstrap partition.

in my case it is like <bootstrapSchemaClass>org.apache.directory.server.schema.bootstrap.CustomSchema</bootstrapSchemaClass>

Note that IMO this may not be certainly the best approach to solve the problem but hope this eliminates the
    need to import the schema manually.

HTH
Kiran Ayyagari

Mark Derricutt wrote:
To be a bit more accurate - the exception I see when loading my LDIF files is:

entry.DefaultServerEntry - The attribute 'smxpartyid' cannot be stored
javax.naming.NamingException: objectClass w/ OID 1.3.6.1.4.1.28416.1.1.1.101 not registered! at org.apache.directory.server.schema.registries.DefaultObjectClassRegistry.lookup(DefaultObjectClassRegistry.java:114) at org.apache.directory.server.core.schema.SchemaInterceptor.alterObjectClasses(SchemaInterceptor.java:1069) at org.apache.directory.server.core.schema.SchemaInterceptor.check(SchemaInterceptor.java:1675) at org.apache.directory.server.core.schema.SchemaInterceptor.add(SchemaInterceptor.java:1819) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1189) at org.apache.directory.server.core.operational.OperationalAttributeInterceptor.add(OperationalAttributeInterceptor.java:191)

I assume from this that the server is aware of my schema, as it managed to deduce the OID to use.

mark

On Tue, Sep 23, 2008 at 12:29 PM, Mark Derricutt <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    As a further experiment, I copied the entire
    DefaultDirectoryService class to my own code, and added my schema
    to the
    BootstrapSchemaLoader along with the other schema classes, then
    reassigned the directoryService variable as:


        public void configureDirectoryService() throws Exception {
            directoryService = new SmxDirectoryService();
            directoryService.setShutdownHookEnabled( false );
            directoryService.setAllowAnonymousAccess( false );
            ldapService.setDirectoryService( directoryService );

    But this also didn't appear to work, hopefully someone who knows
    the proper way of doing this can help out here?



    On Mon, Sep 22, 2008 at 5:11 PM, Mark Derricutt <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:


        
http://directory.apache.org/apacheds/1.5/using-apacheds-for-unit-tests.html

        which currently says its out of date.  In the mean time I'll
        continue hunting for a solution.

        Mark


        On Mon, Sep 15, 2008 at 12:19 PM, Alex Karasulu
        <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

            Just look at the code in the JUnit base classes that
            enable a schema.  Push that code into your TestNG
            harness.  It's rather simple.





-- "It is easier to optimize correct code than to correct optimized
    code." -- Bill Harlan




--
"It is easier to optimize correct code than to correct optimized code." -- Bill Harlan

Reply via email to