Issue Details (XML | Word | Printable)

Key: DIRSERVER-763
Type: Wish Wish
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Emmanuel Lecharny
Reporter: Ralf Hauser
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Support for migrating from RC1 to 1.0 - NullPointerException in DefaultPartitionNexus.java:531

Created: 23/Oct/06 06:34 PM   Updated: 09/Sep/08 07:17 AM
Return to search
Component/s: core
Affects Version/s: 1.0
Fix Version/s: 1.5.1, 1.0.3

Time Tracking:
Not Specified

Resolution Date: 16/Aug/07 09:15 PM


 Description  « Hide
First, congrats to your release.

When trying to reap the benefits of the fixed DIRSERVER-651, I had to do a few replacements of DirectoryPartition with Partition and MutableDirectoryPartitionConfiguration with MutablePartitionConfiguration ...
but when trying to start my ldap with
                       cfg.setWorkingDirectory(workingDir);
java.util.Hashtable jndiEnv = cfg.toJndiEnvironment();
log.debug("jndiEnv.size(): " + jndiEnv.size() + ", env " + env);
env.putAll(cfg.toJndiEnvironment());
new InitialDirContext(env);
I get

DEBUG [main] (ApacheDSHandler.java:464) - jndiEnv.size(): 1, env {java.naming.factory.initial=org.apache.directory.server.jndi.ServerContextFactory, java.naming.provider.url=ou=system, java.naming.security.principal=uid=admin,ou=system, java.naming.security.authentication=simple, java.naming.security.credentials=secret}
531 [main] INFO org.apache.directory.server.core.DefaultDirectoryService - ApacheDS shutdown hook has been registered with the runtime.
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute byteCode does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute dynamicSubtrees does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute subtreeSpecification does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute krb5Key does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute userSMIMECertificate does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute pgpBaseKeySpaceDN does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute subtreeMaximumQuality does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute singleLevelQuality does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute supportedSASLMechanisms does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute subtreeMinimumQuality does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute pgpReconData does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute authorityRevocationList does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute supportedLDAPVersion does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute cACertificate does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute supportedControl does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute nisNetgroupTriple does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute pgpSoftware does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute userPKCS12 does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute crossCertificatePair does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute supportedAlgorithms does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute userCertificate does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute otherMailbox does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute searchGuide does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute certificateRevocationList does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute javaSerializedData does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute namingContexts does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute jpegPhoto does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute altServer does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute supportedExtension does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute pgpVersion does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute enhancedSearchGuide does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute c-FacsimileTelephoneNumber does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute bootParameter does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute deltaRevocationList does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute personalSignature does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute telexNumber does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute dSAQuality does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute pgpData does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute mailPreferenceOption does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute c-TelexNumber does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute audio does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute entryTtl does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute preferredDeliveryMethod does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute pgpKey does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute teletexTerminalIdentifier does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute photo does not have normalizer : using NoopNormalizer
1500 [main] WARN org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry - Attribute facsimileTelephoneNumber does not have normalizer : using NoopNormalizer
1562 [main] INFO org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition - Using the custom configured cache size of 500 for system partition
1656 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute objectClass
1687 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute 1.2.6.1.4.1.18060.1.1.1.3.4
1718 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute 1.2.6.1.4.1.18060.1.1.1.3.1
1765 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute 1.2.6.1.4.1.18060.1.1.1.3.6
1797 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute 1.2.6.1.4.1.18060.1.1.1.3.7
1812 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute 1.2.6.1.4.1.18060.1.1.1.3.3
1828 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute 1.2.6.1.4.1.18060.1.1.1.3.2
1828 [main] WARN org.apache.directory.server.core.partition.impl.btree.BTreePartition - Using default cache size of 100 for index on attribute 1.2.6.1.4.1.18060.1.1.1.3.5
ERROR [main] (ApacheDSHandler.java:473) -
java.lang.NullPointerException
at org.apache.directory.server.core.partition.DefaultPartitionNexus.addContextPartition(DefaultPartitionNexus.java:531)
at org.apache.directory.server.core.partition.DefaultPartitionNexus.init(DefaultPartitionNexus.java:208)
at org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:819)
at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:229)
at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext(AbstractContextFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:82)

Is there any documentation with hints what I have to do?

   Regards Ralf

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Emmanuel Lecharny added a comment - 24/Oct/06 01:17 AM
Well, it seems that the faulty line is :
partitions.put( partition.getSuffix().toString(), partition );

So two guess :
1) partition is NULL
or
2) partition.getSuffix() is NULL

In both cases, there should be something wrong regarding your partition setting, as the trace show that the system partition is initialiazing correctly.

Can you create a simple test case (with a main method) which can be used to reproduce the problem you have ?

Note : we could also add some defensive tests into the code ;)

Ralf Hauser added a comment - 24/Oct/06 04:52 AM
Haven't made a full stand-alone test set yet, but some first hints that may solve the problem:

Set partCfgs = new HashSet();
MutablePartitionConfiguration pgpkeysPartitionConfiguration = new MutablePartitionConfiguration();
...
partCfgs.add(certsPartitionConfiguration);
log.debug(certsPartitionConfiguration + ", certsPartitionConfiguration.getSuffix(): \""
+ certsPartitionConfiguration.getSuffix() + "\"");
...
cfg.setContextPartitionConfigurations(partCfgs);
...
and then follows the code already cited.

Doing this results in the following lines before the log I cited originally
DEBUG [main] (ApacheDSHandler.java:309) - org.apache.directory.server.core.configuration.MutablePartitionConfiguration@1e29b99, pgpkeysPartitionConfiguration.getSuffix(): "dc=pgpkeys"
DEBUG [main] (ApacheDSHandler.java:329) - org.apache.directory.server.core.configuration.MutablePartitionConfiguration@e4e358, certsPartitionConfiguration.getSuffix(): "dc=certs"

Ralf Hauser added a comment - 24/Oct/06 11:12 PM
Ok, got head from svn and noticed that I can't get around really implementing the new methods in the partitions (not partitionconfigurations)
- LdapDN getSuffix()
- LdapDN getUpSuffix()
and not just have eclipse add the missing method stubs... ;)

The same applied to the new methods that now use the LdapName instead of the simple Name.

Now, it starts up as before, except that I see

114015 [main] WARN org.apache.directory.server.core.DefaultDirectoryService - You didn't change the admin password of directory service instance 'default'. Please update the admin password as soon as possible to prevent a possible security breach.

and then when before I was ok, I get

114328 [main] INFO org.apache.directory.server.jndi.ServerContextFactory - Successful bind of an LDAP Service (2636) is complete.
ERROR [main] (ApacheDSHandler.java:438) - Unexpected exception.
org.apache.directory.server.core.interceptor.InterceptorException: Unexpected exception. [Root exception is java.lang.IllegalStateException: Attempted operation by unauthenticated caller.]
at org.apache.directory.server.core.interceptor.InterceptorChain.throwInterceptorException(InterceptorChain.java:1510)
at org.apache.directory.server.core.interceptor.InterceptorChain.access$700(InterceptorChain.java:52)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.hasEntry(InterceptorChain.java:1334)
at org.apache.directory.server.core.normalization.NormalizationService.hasEntry(NormalizationService.java:333)
at org.apache.directory.server.core.interceptor.InterceptorChain.hasEntry(InterceptorChain.java:891)
at org.apache.directory.server.core.partition.PartitionNexusProxy.hasEntry(PartitionNexusProxy.java:547)
at org.apache.directory.server.core.partition.PartitionNexusProxy.hasEntry(PartitionNexusProxy.java:535)
at org.apache.directory.server.core.jndi.ServerContext.<init>(ServerContext.java:129)
at org.apache.directory.server.core.jndi.ServerDirContext.<init>(ServerDirContext.java:82)
at org.apache.directory.server.core.jndi.ServerLdapContext.<init>(ServerLdapContext.java:63)
at org.apache.directory.server.core.DefaultDirectoryService.getJndiContext(DefaultDirectoryService.java:170)
at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext(AbstractContextFactory.java:137)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:82)
Caused by: java.lang.IllegalStateException: Attempted operation by unauthenticated caller.
at org.apache.directory.server.core.authn.AuthenticationService.checkAuthenticated(AuthenticationService.java:434)
at org.apache.directory.server.core.authn.AuthenticationService.hasEntry(AuthenticationService.java:257)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.hasEntry(InterceptorChain.java:1326)

when stepping through, I see the principal here named "unauthenticated caller" is null - what would I have to set for this to work? Some default admin somewhere?

Ralf Hauser added a comment - 25/Oct/06 03:49 AM
and when I try to test it with a client that does use a username/password, I get

workspace> ldapsearch -x -H ldaps://localhost:2636 -D "dn=bugs" -w bunny -b "dc=pgpkeys" pgpuserid='@test*' -vvv
ldap_bind: Loop detected (54)
        additional info: Bind failed: Unexpected exception.

Ralf Hauser added a comment - 25/Oct/06 04:37 AM
see also DIRSERVER-768 re better debug output in authentication service

Emmanuel Lecharny added a comment - 22/Mar/07 06:14 PM
Should be investigated...

Emmanuel Lecharny added a comment - 16/Aug/07 09:15 PM
I have added some checks in 1.5.1 to guarantee that you get valid error messages if the partition is not correctly set. There is nothing more we can do. At least, no more NPE will be thrown.