2010-06-10 1 views
1

나는 봄 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) 

어떤 아이디어를? 미리 감사드립니다.

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

그렇지 않으면 당신도 지금까지 당신이로 점점되지 않을 것이다 ... 다음과 같이

답변

0

첫째을, 나는 당신의 LDIF 파일이 실제로 여러 줄에 걸쳐 분할되어 가정합니다.

질문에 대답하기 위해 존재하지 않는 문맥 (예 : "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 

나는 이것을 Spring 3.0.3.RELEASE와 ApacheDS 1.5.5로 테스트했다.

P.S. StackOverflow에 게시 할 때 코드를 포맷하고, 자취를 쌓고, 데이터 등을 코드로 입력하십시오 (예 : 편집 모드에서 관련 텍스트를 강조 표시하고 "코드 샘플"버튼을 클릭하십시오). 그것은 귀하의 게시물을 훨씬 더 읽기 쉽게 만들어 사람들이 당신을 도울 가능성이 더 높습니다.

6

같은 문제가 발생했습니다. 해결책은 Spring Security에서 ldap-server 태그의 "root"- 속성으로 올바른 컨텍스트를 추가하는 것이 었습니다. 귀하의 경우 :

<security:ldap-server ldif="classpath:foo.ldif" root="dc=example,dc=com"/>