org.sonatype.security.ldap.dao.NoLdapUserRolesFoundException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I tried adding a unit test to org.sonatype.security.ldap.dao.LdapGroupDAOTest in ldap-common module. Since all the unit test methods are using Junit 4x annotations I assumed these were being used to run the tests. It turns out that this is not forced ( it used to be afaik ) and instead Junit delegates to org.junit.internal.runners.JUnit38ClassRunner instead since in above case depends on AbstractLdapTestEnvironment from https://github.com/sonatype/sisu-ldap-testsuite/tree/plexus-ldap-testsuite-1.4 which extends PlexusTestCase which finally extends Junit 3x TestCase. Surefire decides that Junit 3 runer must be used then. This leads to confusion in writing additional tests and who knows if some test methods are not being run because they are not named properly. {quote} ------------------------------------------------------------------------------- Test set: org.sonatype.security.ldap.dao.LdapGroupDAOTest ------------------------------------------------------------------------------- Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.803 sec <<< FAILURE! testUsingInvalidGroupMemberFormat(org.sonatype.security.ldap.dao.LdapGroupDAOTest) Time elapsed: 0.768 sec <<< ERROR! org.sonatype.security.ldap.dao.NoLdapUserRolesFoundException: No roles found for user: cstamas at org.sonatype.security.ldap.dao.DefaultLdapGroupDAO.getGroupMembership(DefaultLdapGroupDAO.java:86) at org.sonatype.security.ldap.dao.LdapGroupDAOTest.doTestWithGroupMemberFormat(LdapGroupDAOTest.java:79) at org.sonatype.security.ldap.dao.LdapGroupDAOTest.testUsingInvalidGroupMemberFormat(LdapGroupDAOTest.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) *at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)* at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) {quote}
    via by Peter Lynch,
    • org.sonatype.security.ldap.dao.NoLdapUserRolesFoundException: No roles found for user: cstamas at org.sonatype.security.ldap.dao.DefaultLdapGroupDAO.getGroupMembership(DefaultLdapGroupDAO.java:86) at org.sonatype.security.ldap.dao.LdapGroupDAOTest.doTestWithGroupMemberFormat(LdapGroupDAOTest.java:79) at org.sonatype.security.ldap.dao.LdapGroupDAOTest.testUsingInvalidGroupMemberFormat(LdapGroupDAOTest.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238)
    No Bugmate found.