• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic