directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: NullPointerException in assertSubtreeScope
Date Tue, 12 Feb 2008 14:18:18 GMT
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