No webapplicationcontext found:no contextloaderlistener registered? Error resolution

Source: Internet
Author: User

<span style= "font-family:arial, Helvetica, Sans-serif; Background-color:rgb (255, 255, 255); " > ran a new SSI framework today. Report the following error:</span>

<span style= "FONT-SIZE:18PX;" > Severity: Exception sending context initialized event to listener instance of class Com.j.chat.upgrade.web.core.systemlaunc HListenerjava.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</span>

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 of the next, I was in the systemlaunchlistener inside the execution of the time, foundContextloaderlistener This listener is not registered. Is it because these two listener have been executed successively? Set the order of the two listeners and put the spring listener in the front. Restart Tomcat, there is no such error.

Online Search the Web. xml file in the execution sequence of the listener. The following is a credible statement:

Described in the Java Web specification. Initialized in the order of Listner,filter,servlet.
Where listener is executed in the order in which they are declared in Web. Xml. There are no concurrency scenarios.



/p>

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.