directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Icky Dude" <ickyd...@gmail.com>
Subject Re: NullPointerException in assertSubtreeScope
Date Tue, 12 Feb 2008 16:23:58 GMT
Emmanuel,

I do call directoryService.startup() in fact it's the startup()
codepath itself that results in the NPE.   Note the stack trace
(repeated below) from the original post:

Exception in thread "main" java.lang.NullPointerException
       at org.apache.directory.server.core.partition.impl.btree.ScopeEvaluator.assertSubtreeScope(ScopeEvaluator.java:94)
       at org.apache.directory.server.core.partition.impl.btree.ScopeEvaluator.evaluate(ScopeEvaluator.java:71)
       at org.apache.directory.server.core.partition.impl.btree.LeafEvaluator.evaluate(LeafEvaluator.java:192)
       at org.apache.directory.server.core.partition.impl.btree.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:104)
       at org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator$2.assertCandidate(ExpressionEnumerator.java:262)
       at org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration.prefetch(IndexAssertionEnumeration.java:163)
       at org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration.<init>(IndexAssertionEnumeration.java:68)
       at org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator.enumConj(ExpressionEnumerator.java:275)
       at org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator.enumerate(ExpressionEnumerator.java:148)
       at org.apache.directory.server.core.partition.impl.btree.DefaultSearchEngine.search(DefaultSearchEngine.java:127)
       at org.apache.directory.server.core.partition.impl.btree.BTreePartition.search(BTreePartition.java:322)
       at org.apache.directory.server.core.schema.SchemaPartitionDao.listAllNames(SchemaPartitionDao.java:730)
       at org.apache.directory.server.core.schema.PartitionSchemaLoader.loadEnabled(PartitionSchemaLoader.java:203)
       at org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1389)
       at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:775)
<==== The calling startup().

Can someone try to reproduce this using the code in this email thread?
If someone else gives it a shot and reports that the code works fine,
then I'll know for sure that is something to do with my classpath
(which I've checked at least a dozen times) or other configuration.


On Feb 12, 2008 7:18 AM, Emmanuel Lecharny <elecharny@gmail.com> wrote:
>
> Icky Dude wrote:
> > Emmanuel,
> >
> >
> > Yes, the NPE occurs on line ScopeEvaluator.java:94 because dn is null.
> >  Yes node is non-null.
> >
> > I get the NPE when initializing a DefaultDirectoryService (in what I
> > think is the simplest possible way).  I'm pretty sure I'm using right
> > bootstrap jars because I just built them and installed them into my my
> > M2_REPO):
> >
> > ...
> > ./repository/org/apache/directory/server/apacheds-bootstrap-partition/1.5.2-SNAPSHOT/apacheds-bootstrap-partition-1.5.2-SNAPSHOT.jar
> > ./repository/org/apache/directory/server/apacheds-schema-bootstrap/1.5.2-SNAPSHOT/apacheds-schema-bootstrap-1.5.2-SNAPSHOT.jar
> > ...
> >
> > I can reproduce the problem using the following code (sorry there are
> > some minor syntax problems having some problems cut-n-paste to my
> > webmail) :
> >
> > --- begin code ---
> >
> > import org.apache.directory.server.core.DefaultDirectoryService;
> > import org.apache.directory.server.ldap.LdapServer;
> > import org.apache.directory.server.protocol.shared.SocketAcceptor;
> > import org.apache.mina.common.ByteBuffer;
> > import org.apache.mina.common.SimpleByteBufferAllocator;
> > iimport javax.naming.NamingException;
> > import java.io.IOException;
> >
> > class HelloWorldImaDirectory
> > {
> >       private static int LDAP_PORT = 389;
> >
> >       public static void main( String[] args)
> >       {
> >               DefaultDirectoryService directoryService = new DefaultDirectoryService();
> >               LdapServer ldapServer = new LdapServer();
> >
> >               try
> >               {
> >               directoryService.startup();
> >               ByteBuffer.setAllocator( new SimpleByteBufferAllocator() );
> >               ByteBuffer.setUseDirectBuffers( false );
> >               SocketAcceptor tcpAcceptor = new SocketAcceptor( null );
> >               ldapServer.setSocketAcceptor( tcpAcceptor );
> >               ldapServer.setDirectoryService( directoryService );
> >
> You have to add this line here :
> directoryService.startup();
>
> Otherwise the schemas won't be loaded, leading to NPE all over the
> execution...
>
> --
>
> --
> cordialement, regards,
> Emmanuel L├ęcharny
> www.iktek.com
> directory.apache.org
>
>
>

Mime
View raw message