• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Eugene Smola
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic