java.lang.IllegalStateException: Failed to load ApplicationContext

iteye.com | 2 months ago
  1. 0

    spring junit与swagger的冲突 - Spring - Java - ITeye论坛

    iteye.com | 2 months ago
    java.lang.IllegalStateException: Failed to load ApplicationContext
  2. 0

    Spring: Can't load the application context. NoSuchBeanDefinitionException

    Stack Overflow | 2 years ago | Dirk Rother
    java.lang.IllegalStateException: Failed to load ApplicationContext
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    How to use java enum as bean in spring

    Stack Overflow | 4 years ago | Betlista
    java.lang.IllegalStateException: Failed to load ApplicationContext

  1. rlovtangen 2 times, last 2 weeks ago
  2. tvrmsmith 6 times, last 2 weeks ago
  3. kjhdofjosvs 1 times, last 3 weeks ago
  4. Andreas Häber 2 times, last 4 weeks ago
  5. Luka 14 times, last 2 months ago
21 more registered users
74 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.NoSuchBeanDefinitionException

    No qualifying bean of type [javax.servlet.ServletContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException()
  2. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:993)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    2. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:863)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    3. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:775)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    4. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    5. org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    6. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    10. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    11. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    12. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    13. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    14. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633)[spring-beans-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    14 frames
  3. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-context-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    2 frames
  4. Spring TestContext
    SpringJUnit4ClassRunner$1.runReflectiveCall
    1. org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    2. org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    3. org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    4. org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    5. org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    6. org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    7. org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    8. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    9. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    10. org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    11. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    12. org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    12 frames
  5. JUnit
    ReflectiveCallable.run
    1. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)[junit-4.11.jar:na]
    1 frame
  6. Spring TestContext
    SpringJUnit4ClassRunner.runChild
    1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    2. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    3. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    3 frames
  7. JUnit
    ParentRunner$2.evaluate
    1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)[junit-4.11.jar:na]
    2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)[junit-4.11.jar:na]
    3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)[junit-4.11.jar:na]
    4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)[junit-4.11.jar:na]
    5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)[junit-4.11.jar:na]
    5 frames
  8. Spring TestContext
    RunAfterTestClassCallbacks.evaluate
    1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    2 frames
  9. JUnit
    ParentRunner.run
    1. org.junit.runners.ParentRunner.run(ParentRunner.java:309)[junit-4.11.jar:na]
    1 frame
  10. Spring TestContext
    SpringJUnit4ClassRunner.run
    1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)[spring-test-3.2.9.RELEASE.jar:3.2.9.RELEASE]
    1 frame
  11. JUnit4 Runner
    JUnit4TestReference.run
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)[.cp/:na]
    1 frame
  12. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)[.cp/:na]
    2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)[.cp/:na]
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)[.cp/:na]
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)[.cp/:na]
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)[.cp/:na]
    5 frames