1

私はSpring 3.0.2とApacheDS 1.5.5を使用しており、次を使用して組み込みサーバーを実行しようとしています:

<ldap-server ldif="classpath:conf/users.ldif" port="39999"/>

user.s.ldif ファイルの内容は次のとおりです。

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

しかし、私はいつもこのエラーを受け取ります:

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.DefaultPartitionNexus.getPartition(DefaultPartitionNexus. java:1082)
at org.apache.directory.server.core.partition.DefaultPartitionNexus.hasEntry(DefaultPartitionNexus.java :1037)
at org.apache.directory.server.core.interceptor.InterceptorChain$1.hasEntry(InterceptorChain.java:167)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.hasEntry(InterceptorChain.java :1300)
at org.apache.directory.server.core.interceptor.BaseInterceptor.hasEntry(BaseInterceptor.java:159)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.hasEntry(InterceptorChain.java :1300)
at org.apache.directory.server.core.interceptor.BaseInterceptor.hasEntry(BaseInterceptor.java:159)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.hasEntry(InterceptorChain.java :1300)
at org.apache.directory.server.core.exception.ExceptionInterceptor.add(ExceptionInterceptor.java:154)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1196 )
at org.apache.directory.server.core.referral.ReferralInterceptor.add(ReferralInterceptor.java:251)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1196 )
at org.apache.directory.server.core.authn.AuthenticationInterceptor.add(AuthenticationInterceptor.java: 212)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1196 )
at org.apache.directory.server.core.normalization.NormalizationInterceptor.add(NormalizationInterceptor .java:126)
at org.apache.directory.server.core.interceptor.InterceptorChain.add(InterceptorChain.java:756)
at org.apache.directory.server.core.DefaultOperationManager.add(DefaultOperationManager.java:260)
at org.apache.directory.server.core.DefaultCoreSession.add(DefaultCoreSession.java:145)
at org.apache.directory.server.core.DefaultCoreSession.add(DefaultCoreSession.java:122)
at org.apache.directory.server.protocol.shared.store.LdifFileLoader.execute(LdifFileLoader.java:204)
at org.springframework.security.ldap.server.ApacheDSContainer.importLdifs(ApacheDSContainer.java:237)
at org.springframework.security.ldap.server.ApacheDSContainer.start(ApacheDSContainer.java:189)

何か案は ?前もって感謝します!

4

2 に答える 2

6

私は同じ問題を経験しました。解決策は、Spring Security の ldap-server タグの「root」属性として正しいコンテキストを追加することでした。あなたの場合:

<security:ldap-server ldif="classpath:foo.ldif"  root="dc=example,dc=com"/>
于 2012-10-11T08:04:49.053 に答える
0

まず、LDIFファイルが実際には次のように数行に分割されていると仮定します。

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

...さもなければ、あなたはあなたがいるところまで到達することさえできないでしょう。

しかし、あなたの質問に答えるために、存在しないコンテキスト(つまり、 "dc = example、dc = com")に何か(この場合はorganizationalRole)を追加しようとしているため、エラーが発生します。そのコンテキストを存在するコンテキストに変更してみてください。Spring Beanファイルが表示されないと、これがどうなるかはわかりませんが、デフォルトでは、Springの組み込みLDAPサーバーは「dc = springframework、dc = org」のルートを使用するため、LDIFファイルを次のように変更してみてください。

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

Spring3.0.3.RELEASEとApacheDS1.5.5でこれをテストしました。

PS StackOverflowに投稿するときは、コード、スタックトレース、テストデータなどをコードとしてフォーマットしてください(たとえば、編集モードで、関連するテキストを強調表示して、[コードサンプル]ボタンをクリックします)。それはあなたの投稿をはるかに読みやすくし、したがって人々はあなたを助ける可能性が高くなります。

于 2010-10-19T02:58:26.640 に答える