SEC-2016: LDAP-based unit tests for spring-security-config project fail #2231

Closed
spring-issuemaster opened this Issue Jul 20, 2012 · 1 comment

2 participants

@spring-issuemaster

John Rodriguez (Migrated from SEC-2016) said:

When I execute a Run As->JUnit Test from the "spring-security-config" project off the master branch, 9 out of the 105 tests fail. All of them fail in a similar manner; not able to find a DN in the embedded ApacheDS server.

When discussing on the forum, Rob W. added that "this is a problem that exists with the test setup in Eclipse. The issue has to do with having multiple *.ldif files available on the classpath."

Here's the stack trace:

org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - NO_SUCH_OBJECT: failed for SearchRequest
baseDn : '0.9.2342.19200300.100.1.1=ben,2.5.4.11=people,0.9 .2342.19200300.100.1.25=springframework,0.9.2342.1 9200300.100.1.25=org'
filter : '(2.5.4.0=*)'
scope : base object
typesOnly : false
Size Limit : no limit
Time Limit : no limit
Deref Aliases : deref Always
attributes :
: Attempt to search under non-existant entry: uid=ben,ou=people,dc=springframework,dc=org]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - NO_SUCH_OBJECT: failed for SearchRequest
baseDn : '0.9.2342.19200300.100.1.1=ben,2.5.4.11=people,0.9 .2342.19200300.100.1.25=springframework,0.9.2342.1 9200300.100.1.25=org'
filter : '(2.5.4.0=*)'
scope : base object
typesOnly : false
Size Limit : no limit
Time Limit : no limit
Deref Aliases : deref Always
attributes :
: Attempt to search under non-existant entry: uid=ben,ou=people,dc=springframework,dc=org]; remaining name 'uid=ben,ou=people'
at org.springframework.ldap.support.LdapUtils.convert LdapException(LdapUtils.java:174)
at org.springframework.ldap.core.LdapTemplate.execute WithContext(LdapTemplate.java:810)
at org.springframework.ldap.core.LdapTemplate.execute ReadOnly(LdapTemplate.java:793)
at org.springframework.ldap.core.LdapTemplate.lookup( LdapTemplate.java:834)
at org.springframework.security.config.ldap.LdapServe rBeanDefinitionParserTests.embeddedServerCreationC ontainsExpectedContextSourceAndData(LdapServerBean DefinitionParserTests.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExpl osively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod .evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunAfters.ev aluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner. java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.ja va:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)
Caused by: javax.naming.NameNotFoundException: [LDAP: error code 32 - NO_SUCH_OBJECT: failed for SearchRequest
baseDn : '0.9.2342.19200300.100.1.1=ben,2.5.4.11=people,0.9 .2342.19200300.100.1.25=springframework,0.9.2342.1 9200300.100.1.25=org'
filter : '(2.5.4.0=*)'
scope : base object
typesOnly : false
Size Limit : no limit
Time Limit : no limit
Deref Aliases : deref Always
attributes :
: Attempt to search under non-existant entry: uid=ben,ou=people,dc=springframework,dc=org]; remaining name 'uid=ben,ou=people'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.jav a:3066)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCt x.java:2987)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCt x.java:2794)
at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:10 11)
at com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup (ComponentContext.java:526)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.l ookup(PartialCompositeContext.java:159)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.l ookup(PartialCompositeContext.java:148)
at javax.naming.InitialContext.lookup(InitialContext. java:392)
at org.springframework.ldap.core.LdapTemplate$10.exec uteWithContext(LdapTemplate.java:836)
at org.springframework.ldap.core.LdapTemplate.execute WithContext(LdapTemplate.java:807)
... 26 more 
@spring-issuemaster

Rob Winch said:

Thank you for submitting this issue. I have fixed it in master.

@spring-issuemaster spring-issuemaster added this to the 3.1.2 milestone Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment