java.lang.IllegalStateException: Failed to load ApplicationContext

Stack Overflow | sfrj | 5 months ago
  1. 0

    Cant run Spring integration test because container doesn't start

    Stack Overflow | 5 months ago | sfrj
    java.lang.IllegalStateException: Failed to load ApplicationContext
  2. 0

    Cant run Spring integration test because container doesn't start

    codegur.com | 3 months ago
    java.lang.IllegalStateException: Failed to load ApplicationContext
  3. 0

    Can't run spring boot unit tests with GAE

    Stack Overflow | 11 months ago | james
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)Ljavax/servlet/ServletRegistration$Dynamic;
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet

    Stack Overflow | 2 months ago | YJ. Yang
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)Ljavax/servlet/ServletRegistration$Dynamic;
  6. 0

    NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)

    Stack Overflow | 2 months ago | YJ. Yang
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)Ljavax/servlet/ServletRegistration$Dynamic;

    2 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. java.lang.NoSuchMethodError

      javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)Ljavax/servlet/ServletRegistration$Dynamic;

      at org.springframework.boot.context.embedded.ServletRegistrationBean.onStartup()
    2. Spring Boot
      ServletContextInitializerConfiguration$Initializer.doStart
      1. org.springframework.boot.context.embedded.ServletRegistrationBean.onStartup(ServletRegistrationBean.java:190)
      2. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:225)
      3. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:85)
      4. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:209)
      5. org.springframework.boot.context.embedded.jetty.ServletContextInitializerConfiguration$Initializer.callInitializers(ServletContextInitializerConfiguration.java:83)
      6. org.springframework.boot.context.embedded.jetty.ServletContextInitializerConfiguration$Initializer.doStart(ServletContextInitializerConfiguration.java:72)
      6 frames
    3. Jetty
      AbstractLifeCycle.start
      1. org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      2. org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      3. org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
      4. org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      5. org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:120)
      6. org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:784)
      7. org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)
      8. org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
      9. org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
      10. org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
      11. org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
      12. org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      13. org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      14. org.eclipse.jetty.server.Server.start(Server.java:387)
      15. org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
      16. org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      17. org.eclipse.jetty.server.Server.doStart(Server.java:354)
      18. org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      18 frames
    4. Spring Boot
      EmbeddedWebApplicationContext.onRefresh
      1. org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.initialize(JettyEmbeddedServletContainer.java:85)
      2. org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.<init>(JettyEmbeddedServletContainer.java:74)
      3. org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory.getJettyEmbeddedServletContainer(JettyEmbeddedServletContainerFactory.java:472)
      4. org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory.getEmbeddedServletContainer(JettyEmbeddedServletContainerFactory.java:163)
      5. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:160)
      6. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
      6 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
      1 frame
    6. Spring Boot
      SpringApplicationContextLoader.loadContext
      1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
      2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
      3. org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
      4. org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
      5. org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98)
      5 frames
    7. org.springframework.test
      DefaultCacheAwareContextLoaderDelegate.loadContext
      1. org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
      2. org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
      2 frames
    8. Spring TestContext
      SpringJUnit4ClassRunner$1.runReflectiveCall
      1. org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
      2. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
      3. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
      4. org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
      5. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230)
      6. org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
      6 frames
    9. JUnit
      ReflectiveCallable.run
      1. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      1 frame
    10. Spring TestContext
      SpringJUnit4ClassRunner.runChild
      1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
      2. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:249)
      3. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
      3 frames
    11. JUnit
      ParentRunner$2.evaluate
      1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      5 frames
    12. Spring TestContext
      RunAfterTestClassCallbacks.evaluate
      1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
      2 frames
    13. JUnit
      ParentRunner.run
      1. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      1 frame
    14. Spring TestContext
      SpringJUnit4ClassRunner.run
      1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)
      1 frame
    15. JUnit
      JUnitCore.run
      1. org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      1 frame
    16. IntelliJ junit4 module
      JUnit4IdeaTestRunner.startRunnerWithArgs
      1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
      2. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
      2 frames
    17. IDEA
      JUnitStarter.main
      1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
      2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
      2 frames
    18. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    19. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
      1 frame