No webapplicationcontext found:no contextloaderlistener registered? Error resolution

Source: Internet
Author: User
Tags java web

The

     ran a new SSI framework today. reported the following error:

Serious: Exception sending context initialized event to listener instance of class Com.j.chat.upgrade.web.core.systemlaunchlis
	Tener java.lang.IllegalStateException:No webapplicationcontext found:no contextloaderlistener registered? At Org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext ( webapplicationcontextutils.java:84) at com.j.chat.upgrade.web.core.systemlaunchlistener.contextinitialized ( systemlaunchlistener.java:27) at Org.apache.catalina.core.StandardContext.listenerStart (Standardcontext.java : 4779) at Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5273) at Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150) at org.apache.catalina.core.containerbase$ Startchild.call (containerbase.java:1566) at Org.apache.catalina.core.containerbase$startchild.call ( containerbase.java:1556) at Java.util.concurrent.futuretask$sync.innerrun (futuretask.java:303) at Java.util.concurrent.FutureTask.run (Futuretask.java:138) at Java.util.concurrent.threadpoolexecutor$worker.runtask (threadpoolexecutor.java:886) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:908) at Java.lang.Thread.run ( thread.java:662) 2014-7-14 19:49:10 org.apache.catalina.core.ApplicationContext log information: initializing Spring root Webapplicationcontext

I'm wondering, I've already declared Contextloaderlistener this listener in Web.xml. My web.xml configuration file is as follows:

<listener>
	<listener-class>com.j.chat.upgrade.web.core.systemlaunchlistener</listener-class >
</listener>
<listener>
	<listener-class> org.springframework.web.context.contextloaderlistener</listener-class>
</listener>	
< context-param>
	<param-name>contextConfigLocation</param-name>
	<param-value> Classpath:spring-config.xml</param-value>
</context-param>
Analysis, I was in systemlaunchlistener inside execution, found Contextloaderlistener This listener is not registered. Is it because these two listener were executed successively. Tune the order of the two listeners and put the spring listener at the front. Restart Tomcat, there is no such an error.

Online Search the next Web.xml file in the listener order of execution. Here's a plausible statement:

Described in the Java Web specification. Initialized in the order of Listner,filter,servlet. The listener are executed in the order in which they are declared in Web.xml, and there is no concurrency.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.