Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-3484

When running AnnotationConfig Spring JUnit test: java.lang.SecurityException: class "...$$EnhancerByCGLIB$$91fe93b4"'s signer information does not match signer information of other classes in the same package

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.3.0.RELEASE
    • Fix Version/s: None
    • Component/s: SUPPORT
    • Labels:
      None
    • Environment:
      java version "1.7.0_21"
      Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
      Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

      Description

      A project using Spring 3.2.2.RELEASE (also Spring Batch 2.2.0) fails to run unit test with @Configuration AnnotationConfig due to error below:

      18:38:37 [main] ERROR o.s.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframewor[email protected]1ad905bb] to prepare test instance [[email protected]]
      java.lang.IllegalStateException: Failed to load ApplicationContext
      	at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na]
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na]
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na]
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na]
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na]
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na]
      	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na]
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) [spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) [.cp/:na]
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) [.cp/:na]
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) [.cp/:na]
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) [.cp/:na]
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) [.cp/:na]
      Caused by: java.lang.IllegalStateException: Cannot load configuration class: com.quikdo.freq.job.LocationVisitorAggregatorJobConfig
      	at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:364) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:248) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:708) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:647) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:475) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ~[spring-test-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      	... 25 common frames omitted
      Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
      	at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) ~[org.springframework.core_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) ~[org.springframework.core_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:317) ~[org.springframework.core_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:132) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:92) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:354) ~[org.springframework.context_4.0.0.20130522-M1.jar:4.0.0.M1]
      	... 33 common frames omitted
      Caused by: java.lang.reflect.InvocationTargetException: null
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_21]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_21]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_21]
      	at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_21]
      	at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) ~[org.springframework.core_4.0.0.20130522-M1.jar:4.0.0.M1]
      	at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ~[org.springframework.core_4.0.0.20130522-M1.jar:4.0.0.M1]
      	... 38 common frames omitted
      Caused by: java.lang.SecurityException: class "com.quikdo.freq.job.LocationVisitorAggregatorJobConfig$$EnhancerByCGLIB$$91fe93b4"'s signer information does not match signer information of other classes in the same package
      	at java.lang.ClassLoader.checkCerts(ClassLoader.java:939) ~[na:1.7.0_21]
      	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:653) ~[na:1.7.0_21]
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:781) ~[na:1.7.0_21]
      	... 44 common frames omitted
      

      Note that org.springframework.core_4.0.0.20130522-M1.jar:4.0.0.M1 is not in the project's Maven dependencies, it seems to have leaked from STS's own JARs.

        Attachments

          Activity

            People

            Assignee:
            mlippert Martin Lippert
            Reporter:
            ceefour Hendy Irawan
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: