Note that there are some explanatory texts on larger screens.

plurals
  1. PODeploying Spring Web Applicaiton To JBoss WebApplicationContext Exceptions
    primarykey
    data
    text
    <p>When deploying a Spring Web Application to JBoss 7.1.1, gives the following Exception:</p> <pre><code>12:26:58,053 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/i]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class com.listener.IListener: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:84) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE] at com.listener.IListener.contextInitialized(IListener.java:28) [classes:] at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26] 12:26:58,115 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-3) Error listenerStart 12:26:58,115 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-3) Context [/i] startup failed due to previous errors 12:26:58,131 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.web.deployment.default-host./i: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./i: JBAS018040: Failed to start context at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26] 12:26:58,146 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015951: Admin console listening on http://127.0.0.1:9990 12:26:58,146 ERROR [org.jboss.as] (MSC service thread 1-7) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 4883ms - Started 225 of 304 services (2 services failed or missing dependencies, 76 services are passive or on-demand) 12:26:58,365 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "webchannel.war" was rolled back with failure message {"JBAS014671: Failed services" =&gt; {"jboss.web.deployment.default-host./i" =&gt; "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./i: JBAS018040: Failed to start context"}} 12:26:58,521 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment webchannel.war in 161ms 12:26:58,521 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./i: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./i: JBAS018040: Failed to start context 12:26:58,536 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" =&gt; {"Operation step-2" =&gt; {"JBAS014671: Failed services" =&gt; {"jboss.web.deployment.default-host./i" =&gt; "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./i: JBAS018040: Failed to start context"}}}} </code></pre> <p>I have a ServletContextListener called IListener. When I try to access the WebApplicationContext I receive the above Exception. However, this works in TomEE.</p> <p>Below is the code:</p> <pre><code>public class IListener implements ServletContextListener { public IListener() { } public void contextInitialized(ServletContextEvent event) { ServletContext context = event.getServletContext(); WebApplicationContext webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(context); } public void contextDestroyed(ServletContextEvent event) { } } </code></pre> <p>web.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; </code></pre> <p>http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd" version="2.5"></p> <pre><code> &lt;display-name&gt;JEE WebApp&lt;/display-name&gt; &lt;context-param&gt; &lt;!-- Specifies the list of Spring Configuration files in comma separated format.--&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt; /WEB-INF/spring/services.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;!-- Loads your Configuration Files--&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;listener-class&gt;com.listener.IListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;servlet&gt; &lt;servlet-name&gt;i&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;i&lt;/servlet-name&gt; &lt;url-pattern&gt;/&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; </code></pre> <p></p> <p>Java version is 1.6 and Spring version 3.0.6.RELEASE.</p> <p>I am not sure what to do.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload