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