I am a Spring beginner and have just started creating an application.
I have created small spring applications, but this time i started getting issues in my web.xml.
I am using Eclipse ganymede and am working on a live project which works fine on this IDE.
This new small app started giving trouble.
i am using:
1. tomcat 6.0.29
as i start the server I get the following error "java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener"
i have checked few forums but haven't found a concrete solution.
I don't understand whether its a classpath issue or spring issue or my code.
Because in Helios the server starts but the application fails to run (ie. my index.jsp)
here is my contextLoaderListener in my web.xml file:
Champ, ServletContextListener is an interface that allows us to do something whenever an application is started on the web container/application server. This interface is implemented by the ContextLoaderListener class, and then, Spring is able to configure your application properly.
Now, it looks like this interface is not being found in the class-path. How is your environment? Did you configure Tomcat in your Eclipse and are deploying it there? Or are you generating a WAR file and deploying it outside Eclipse?
I just resolved the problem.
It was with my jars.
I changed my jars and it started working.
I have some other issues coming up with the command object.
But i think i'll research first and if i still don't find an answer then i'll come back and haunt you.
The problem with me was multiple versions of the jars present in the classpath.
I just used the jars from an already deployed projects and it just started working.
I guess it was due to jee jars or spring jars. I didn't really bother to look once it started working.
Anyways I don't know if this will help or not, but still, I am attaching a screen shot of the jars that I
bluntly copied. half of them were never utilized in my project. And also this project that I tried to
recreate was 2 yrs old.
Honk if you love justice! And honk twice for tiny ads!