Spring Security
  1. Spring Security
  2. SEC-2016

LDAP-based unit tests for spring-security-config project fail

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.1.2
    • Component/s: Build and Admin
    • Labels:
      None
    • Environment:
      Windows 7 Enterprise SP1
      Java 1.6
      STS 2.9.2.RELEASE
      STS Gradle Integration 2.9.0.201203010842-RELEASE

      Description

      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 
      

        Activity

        Hide
        Rob Winch added a comment -

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

        Show
        Rob Winch added a comment - Thank you for submitting this issue. I have fixed it in master.

          People

          • Assignee:
            Rob Winch
            Reporter:
            John Rodriguez
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified