java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?

Atlassian JIRA | Rene Medellin | 4 years ago
  1. 0

    [BSERV-2780] No ContextLoaderListener when running atlas-run-standalone stash on Mac OS X Mountain Lion - Atlassian JIRA

    atlassian.com | 1 year ago
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
  2. 0

    Trying to run: $ atlas-run-standalone --product stash on Mac OS X Mountain Lion and getting a startup exception: {noformat} INFO] [talledLocalContainer] SEVERE: StandardWrapper.Throwable [INFO] [talledLocalContainer] java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? [INFO] [talledLocalContainer] at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:90) [INFO] [talledLocalContainer] at org.springframework.web.context.support.HttpRequestHandlerServlet.init(HttpRequestHandlerServlet.java:56) [INFO] [talledLocalContainer] at javax.servlet.GenericServlet.init(GenericServlet.java:212) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314) [INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardService.start(StandardService.java:516) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) [INFO] [talledLocalContainer] at org.apache.catalina.startup.Catalina.start(Catalina.java:583) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) [INFO] [talledLocalContainer] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) {noformat} I modified the web.xml to include the listener: {noformat} rmedellin-mbp:stash-scratch renemedellin$ diff amps-standalone/target/stash/webapp/WEB-INF/web.xml amps-standalone/target/stash/webapp/WEB-INF/web.xml~ 25,28d24 < <!-- To deal with java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered on MacOS X --> < <listener> < <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> < </listener> {noformat} but that results in a slew of other problems: {noformat} [INFO] [talledLocalContainer] SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener [INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'crowdUserDao' defined in class path resource [crowd-spi-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.stash.internal.user.StashUserDao]: : Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginPersistentStateStore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPersistentStateStore' defined in class path resource {noformat} Environment details: {noformat} rmedellin-mbp:stash-scratch renemedellin$ mvn --version Apache Maven 3.0.3 (r1075438; 2011-03-01 04:31:09+1100) Maven home: /usr/share/maven Java version: 1.6.0_35, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.8.2", arch: "x86_64", family: "mac" {noformat}

    Atlassian JIRA | 4 years ago | Rene Medellin
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
  3. 0

    Trying to run: $ atlas-run-standalone --product stash on Mac OS X Mountain Lion and getting a startup exception: {noformat} INFO] [talledLocalContainer] SEVERE: StandardWrapper.Throwable [INFO] [talledLocalContainer] java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? [INFO] [talledLocalContainer] at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:90) [INFO] [talledLocalContainer] at org.springframework.web.context.support.HttpRequestHandlerServlet.init(HttpRequestHandlerServlet.java:56) [INFO] [talledLocalContainer] at javax.servlet.GenericServlet.init(GenericServlet.java:212) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206) [INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314) [INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) [INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardService.start(StandardService.java:516) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) [INFO] [talledLocalContainer] at org.apache.catalina.startup.Catalina.start(Catalina.java:583) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) [INFO] [talledLocalContainer] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) {noformat} I modified the web.xml to include the listener: {noformat} rmedellin-mbp:stash-scratch renemedellin$ diff amps-standalone/target/stash/webapp/WEB-INF/web.xml amps-standalone/target/stash/webapp/WEB-INF/web.xml~ 25,28d24 < <!-- To deal with java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered on MacOS X --> < <listener> < <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> < </listener> {noformat} but that results in a slew of other problems: {noformat} [INFO] [talledLocalContainer] SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener [INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'crowdUserDao' defined in class path resource [crowd-spi-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.stash.internal.user.StashUserDao]: : Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginPersistentStateStore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPersistentStateStore' defined in class path resource {noformat} Environment details: {noformat} rmedellin-mbp:stash-scratch renemedellin$ mvn --version Apache Maven 3.0.3 (r1075438; 2011-03-01 04:31:09+1100) Maven home: /usr/share/maven Java version: 1.6.0_35, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.8.2", arch: "x86_64", family: "mac" {noformat}

    Atlassian JIRA | 4 years ago | Rene Medellin
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    ContextLoaderListener does not recognise Spring Security

    Stack Overflow | 2 years ago | Renya
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
  6. 0

    Spring security in memory authentication does not work

    Stack Overflow | 1 year ago | NevyanovL
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?

    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.IllegalStateException

      No WebApplicationContext found: no ContextLoaderListener registered?

      at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext()
    2. Spring
      HttpRequestHandlerServlet.init
      1. org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:90)[talledLocalContainer]
      2. org.springframework.web.context.support.HttpRequestHandlerServlet.init(HttpRequestHandlerServlet.java:56)[talledLocalContainer]
      2 frames
    3. JavaServlet
      GenericServlet.init
      1. javax.servlet.GenericServlet.init(GenericServlet.java:212)[talledLocalContainer]
      1 frame
    4. Glassfish Core
      Catalina.start
      1. org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)[talledLocalContainer]
      2. org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)[talledLocalContainer]
      3. org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)[talledLocalContainer]
      4. org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)[talledLocalContainer]
      5. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)[talledLocalContainer]
      6. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)[talledLocalContainer]
      7. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)[talledLocalContainer]
      8. org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850)[talledLocalContainer]
      9. org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724)[talledLocalContainer]
      10. org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)[talledLocalContainer]
      11. org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)[talledLocalContainer]
      12. org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)[talledLocalContainer]
      13. org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)[talledLocalContainer]
      14. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)[talledLocalContainer]
      15. org.apache.catalina.core.StandardHost.start(StandardHost.java:722)[talledLocalContainer]
      16. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)[talledLocalContainer]
      17. org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)[talledLocalContainer]
      18. org.apache.catalina.core.StandardService.start(StandardService.java:516)[talledLocalContainer]
      19. org.apache.catalina.core.StandardServer.start(StandardServer.java:710)[talledLocalContainer]
      20. org.apache.catalina.startup.Catalina.start(Catalina.java:583)[talledLocalContainer]
      20 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[talledLocalContainer]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[talledLocalContainer]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[talledLocalContainer]
      4. java.lang.reflect.Method.invoke(Method.java:597)[talledLocalContainer]
      4 frames
    6. Glassfish Core
      Bootstrap.main
      1. org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)[talledLocalContainer]
      2. org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      2 frames