The ContextLoaderListener is used to integrate Spring with other web application.

  <!-- file : web.xml --> 

And the common error message is, your server can not find this Spring ContextLoaderListener class during the server start up.

SEVERE: Error configuring application listener of class 
org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: 
	at org.apache.catalina.loader.WebappClassLoader.loadClass(
	at org.apache.catalina.loader.WebappClassLoader.loadClass(
	at org.apache.catalina.core.StandardContext.listenerStart(
	at org.apache.catalina.core.StandardContext.start(
	at org.apache.catalina.core.ContainerBase.start(
	at org.apache.catalina.core.StandardHost.start(
	at org.apache.catalina.core.ContainerBase.start(
	at org.apache.catalina.core.StandardEngine.start(
	at org.apache.catalina.core.StandardService.start(
	at org.apache.catalina.core.StandardServer.start(
	at org.apache.catalina.startup.Catalina.start(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.start(
	at org.apache.catalina.startup.Bootstrap.main(


This is always happened in deployment and debugging environment.

1.Deployment environment

In deployment environment, just make sure your server classpath has included the Spring jar library (e.g spring-2.5.6.jar).

For Spring3, ContextLoaderListener is moved to spring-web.jar, you can get the library from Maven central repository.


2.Debugging environment

In debugging environment, the steps may vary from different IDE, but the solution is same. In Eclipse, developers usually will create a tomcat, jboss…whatever application server for debugging, just make sure the correct Spring jars are included.

1. Double click on your debugging server
2. Click on the “Open launch configuration” to access the server environment

3. Click on the classpath tab
4. Include the Spring jar file here , it may also required common log jar due to Spring dependency.

5. Done, run your application again.

Tags :
Founder of and, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Related Posts

Popular Posts