views:

80

answers:

1

Hey, I'm using spring 3.0.2 and ApacheDS 1.5.5 and I'm trying to run the embedded server using:

The content of the user.s.ldif file is :

dn: cn=The Postmaster,dc=example,dc=com objectClass: organizationalRole cn: The Postmaster

But I always get this error:

16566 [main] INFO org.apache.directory.server.protocol.shared.store. LdifFileLoader - Could not create entry ClientEntry dn: cn=The Postmaster,dc=example,dc=com objectclass: organizationalRole cn: The Postmaster

org.apache.directory.shared.ldap.exception.LdapNam eNotFoundException: Cannot find a partition for 2.5.4.3=the postmaster,0.9.2342.19200300.100.1.25=example,0.9. 2342.19200300.100.1.25=com at org.apache.directory.server.core.partition.Default PartitionNexus.getPartition(DefaultPartitionNexus. java:1082) at org.apache.directory.server.core.partition.Default PartitionNexus.hasEntry(DefaultPartitionNexus.java :1037) at org.apache.directory.server.core.interceptor.Inter ceptorChain$1.hasEntry(InterceptorChain.java:167) at org.apache.directory.server.core.interceptor.Inter ceptorChain$Entry$1.hasEntry(InterceptorChain.java :1300) at org.apache.directory.server.core.interceptor.BaseI nterceptor.hasEntry(BaseInterceptor.java:159) at org.apache.directory.server.core.interceptor.Inter ceptorChain$Entry$1.hasEntry(InterceptorChain.java :1300) at org.apache.directory.server.core.interceptor.BaseI nterceptor.hasEntry(BaseInterceptor.java:159) at org.apache.directory.server.core.interceptor.Inter ceptorChain$Entry$1.hasEntry(InterceptorChain.java :1300) at org.apache.directory.server.core.exception.Excepti onInterceptor.add(ExceptionInterceptor.java:154) at org.apache.directory.server.core.interceptor.Inter ceptorChain$Entry$1.add(InterceptorChain.java:1196 ) at org.apache.directory.server.core.referral.Referral Interceptor.add(ReferralInterceptor.java:251) at org.apache.directory.server.core.interceptor.Inter ceptorChain$Entry$1.add(InterceptorChain.java:1196 ) at org.apache.directory.server.core.authn.Authenticat ionInterceptor.add(AuthenticationInterceptor.java: 212) at org.apache.directory.server.core.interceptor.Inter ceptorChain$Entry$1.add(InterceptorChain.java:1196 ) at org.apache.directory.server.core.normalization.Nor malizationInterceptor.add(NormalizationInterceptor .java:126) at org.apache.directory.server.core.interceptor.Inter ceptorChain.add(InterceptorChain.java:756) at org.apache.directory.server.core.DefaultOperationM anager.add(DefaultOperationManager.java:260) at org.apache.directory.server.core.DefaultCoreSessio n.add(DefaultCoreSession.java:145) at org.apache.directory.server.core.DefaultCoreSessio n.add(DefaultCoreSession.java:122) at org.apache.directory.server.protocol.shared.store. LdifFileLoader.execute(LdifFileLoader.java:204) at org.springframework.security.ldap.server.ApacheDSC ontainer.importLdifs(ApacheDSContainer.java:237) at org.springframework.security.ldap.server.ApacheDSC ontainer.start(ApacheDSContainer.java:189)

Any Ideas ? Thanks in advance!

A: 

First off, I assume your LDIF file is actually split over several lines, as follows:

dn: cn=The Postmaster,dc=example,dc=com
objectClass: organizationalRole
cn: The Postmaster

... otherwise you wouldn't even be getting as far as you are.

But to answer your question, the error happens because you're trying to add something (in this case an organizationalRole) to a context that doesn't exist (i.e. "dc=example,dc=com"). Try changing that context to one that does exist. I can't say what this would be without seeing your Spring bean file, but by default, Spring's embedded LDAP server uses a root of "dc=springframework,dc=org", so try changing your LDIF file to this:

dn: cn=The Postmaster,dc=springframework,dc=org
objectClass: organizationalRole
cn: The Postmaster

I tested this with Spring 3.0.3.RELEASE and ApacheDS 1.5.5.

P.S. when posting to StackOverflow, please format your code, stack traces, test data etc. as code (e.g. in edit mode, highlight the relevant text and click the "Code sample" button). It makes your post much more readable and people are therefore more likely to help you.

Andrew Swan