I am working on webapp using spring 3.0, hibernate. When I try to deploy my application on WAS 7.0, it gives me an error - Could not load the listener: org.springframework.web.context.ContextLoaderListener]: java.lang.ClassNotFoundException:
This is what my web application looks like:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>ABC</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
The exception is the following:
com.ibm.ws.webcontainer.webapp.WebApp logError SRVE0293E: [Servlet Error]-[Failed to load listener: org.springframework.web.context.ContextLoaderListener]: java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at java.beans.Beans.instantiate(Beans.java:190) at java.beans.Beans.instantiate(Beans.java:75) at com.ibm.ws.webcontainer.webapp.WebApp.loadListener(WebApp.java:1643) at com.ibm.ws.webcontainer.webapp.WebAppImpl.loadListener(WebAppImpl.java:671) at com.ibm.ws.webcontainer.webapp.WebApp.loadLifecycleListeners(WebApp.java:1554)
So, is there something wrong with web.xml?
Edit: Sorry, I didn’t mention, I use Maven to get cans. I have the necessary jar file in the WEB-INF folder, e.g. org.springframework.web.context
Ritesh
source share