java.lang.IllegalStateException

Failed to load ApplicationContext

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web20

  • via Unknown by Johannes Smutny,
  • via Unknown by Johannes Smutny,
  • Stack trace

    • java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:313)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)[junit-4.9.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)[junit-4.9.jar:na] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)[junit-4.9.jar:na] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)[junit-4.9.jar:na] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)[junit-4.9.jar:na] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)[junit-4.9.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.junit.runners.ParentRunner.run(ParentRunner.java:292)[junit-4.9.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)[spring-test-3.2.0.RELEASE.jar:3.2.0.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: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.aggregator.AggregatingMessageHandler#0': Cannot create inner bean '(inner bean)' of type [org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Found ambiguous parameter type [interface java.util.List] for method match: [public static org.mockito.cglib.proxy.MethodProxy at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.CGLIB$findMethodProxy(org.mockito.cglib.core.Signature), public org.mockito.cglib.proxy.Callback at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.getCallback(int), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback[]), public final boolean at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.release(java.util.List), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback), public final java.lang.String at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.correlateBy(at.gv.brz.profit.documentdispatcher.bom.Document)] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:282)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:615)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-context-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:106)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:57)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)[spring-test-3.2.0.RELEASE.jar:3.2.0.RELEASE] ... 24 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Found ambiguous parameter type [interface java.util.List] for method match: [public static org.mockito.cglib.proxy.MethodProxy at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.CGLIB$findMethodProxy(org.mockito.cglib.core.Signature), public org.mockito.cglib.proxy.Callback at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.getCallback(int), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback[]), public final boolean at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.release(java.util.List), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback), public final java.lang.String at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.correlateBy(at.gv.brz.profit.documentdispatcher.bom.Document)] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:271)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] ... 44 more Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Found ambiguous parameter type [interface java.util.List] for method match: [public static org.mockito.cglib.proxy.MethodProxy at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.CGLIB$findMethodProxy(org.mockito.cglib.core.Signature), public org.mockito.cglib.proxy.Callback at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.getCallback(int), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback[]), public final boolean at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.release(java.util.List), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback), public final java.lang.String at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.correlateBy(at.gv.brz.profit.documentdispatcher.bom.Document)] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] ... 49 more Caused by: java.lang.IllegalArgumentException: Found ambiguous parameter type [interface java.util.List] for method match: [public static org.mockito.cglib.proxy.MethodProxy at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.CGLIB$findMethodProxy(org.mockito.cglib.core.Signature), public org.mockito.cglib.proxy.Callback at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.getCallback(int), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback[]), public final boolean at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.release(java.util.List), public java.lang.Object at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.newInstance(org.mockito.cglib.proxy.Callback), public final java.lang.String at.gv.brz.profit.documentdispatcher.service.DocumentAggregatorService$$EnhancerByMockitoWithCGLIB$$1b99f9e0.correlateBy(at.gv.brz.profit.documentdispatcher.bom.Document)] at org.springframework.util.Assert.isNull(Assert.java:89)[spring-core-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.integration.util.MessagingMethodInvokerHelper.findHandlerMethodsForTarget(MessagingMethodInvokerHelper.java:354)[spring-integration-core-2.2.2.RELEASE.jar:na] at org.springframework.integration.util.MessagingMethodInvokerHelper.<init>(MessagingMethodInvokerHelper.java:169)[spring-integration-core-2.2.2.RELEASE.jar:na] at org.springframework.integration.util.MessagingMethodInvokerHelper.<init>(MessagingMethodInvokerHelper.java:121)[spring-integration-core-2.2.2.RELEASE.jar:na] at org.springframework.integration.aggregator.MethodInvokingMessageListProcessor.<init>(MethodInvokingMessageListProcessor.java:57)[spring-integration-core-2.2.2.RELEASE.jar:na] at org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor.<init>(MethodInvokingMessageGroupProcessor.java:48)[spring-integration-core-2.2.2.RELEASE.jar:na] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[na:1.7.0_09] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[na:1.7.0_09] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[na:1.7.0_09] at java.lang.reflect.Constructor.newInstance(Constructor.java:525)[na:1.7.0_09] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] ... 51 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    IP99zillaIP99zilla
    Once,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,