wood burning stoves 2.0*
The moose likes Spring and the fly likes java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener" Watch "java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener" New topic
Author

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

Eugene Smola
Greenhorn

Joined: Nov 21, 2010
Posts: 10
Hello all

Could you please help me with my problem.
I've configured a simlple Spring mvc project (just like in tutorial) and everything was working fine. Then I've decided to split my appcontext-servlet.xml into several files (as "Splitting it into logical pieces across application layers can make maintenance easier by keeping each of the Spring configuration files focused on a single layer of the application" (c) ). So I added the lines below in my web.xml:

After that I get the subject exception while starting tomcat: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

The first I thought that there is no such class in jars which is in my WEB-INF/lib folder, but it here (in org.springframework.web-3.0.4.RELEASE.jar). After some googling I've found that there could be some similar problems with starting tomcat via eclipse, so I just built war (with necessary spring jars in WEB-INF/lib folder ) via ant and deployed it to stand-alone tomcat and it gives me the same error.
Any Ideas?

The tomcat I use is 7.0.2, but the same happens with 6.0.24 tomcat.
Spring - 3.0.4.
The content of WEB-INF/lib dir is:

commons-beanutils-1.8.3.jar
commons-digester-2.1.jar
commons-logging-1.1.1.jar
com.springsource.org.aopalliance-1.0.0.jar
com.springsource.org.apache.commons.logging-1.1.1.jar
jstl-1.1.2.jar
org.springframework.aop-3.0.4.RELEASE.jar
org.springframework.asm-3.0.4.RELEASE.jar
org.springframework.beans-3.0.4.RELEASE.jar
org.springframework.context-3.0.4.RELEASE.jar
org.springframework.context.support-3.0.4.RELEASE.jar
org.springframework.core-3.0.4.RELEASE.jar
org.springframework.expression-3.0.4.RELEASE.jar
org.springframework.oxm-3.0.4.RELEASE.jar
org.springframework.web-3.0.4.RELEASE.jar
org.springframework.web.servlet-3.0.4.RELEASE.jar


The same jars are in built myapp.war in WEB-IN/lib. Can It have something to do with that fact that I have choosen Dynamic web module version 3.0 in "Create Dynamic web project" eclipse wizard?

Thanks!
Eugene Smola
Greenhorn

Joined: Nov 21, 2010
Posts: 10
Guys! I've just resolved that problem. I just type again

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

And it works now! As you can see there was no missprints in my previous configuration. But I just copy and pasted previous "org.springframework.web.context.ContextLoaderListener" from "spring in action" pdf, it seems that it has some wrong characters in it. For example, the cyrillic and latin characters "O" are the same, but has different char codes, you know.

I wasted all morning to find out what the problem !!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Eugene Smola wrote:Guys! I've just resolved that problem. I just type again

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

And it works now! As you can see there was no missprints in my previous configuration. But I just copy and pasted previous "org.springframework.web.context.ContextLoaderListener" from "spring in action" pdf, it seems that it has some wrong characters in it. For example, the cyrillic and latin characters "O" are the same, but has different char codes, you know.

I wasted all morning to find out what the problem !!


Ouch.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener