Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

springDispatcher-servlet.xml: java.io.FileNotFoundException

 
pioneer
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
I'm new to Spring framework, I'm trying to build the sample application mentioned in http://www.springframework.org/docs/Spring-MVC-step-by-step/part1.html
In the example it is not mentioned that we need to put springDispatcher-servlet.xml in WEB-INF folder but When I start the tomcat server, I get the folloiwng exception:

org.springframework.beans.
factory.BeanDefinitionStoreException:
IOException parsing XML document from ServletContext
resource [/WEB-INF/springDispatcher-servlet.xml]; nested exception is
java.io
FileNotFoundException: Could not open ServletContext
resource [/WEB-INF/springDispatcher-servlet.xml]
at org.springframework.beans.
factory.xml.XmlBeanDefinitionReader.
loadBeanDefinitions
(XmlBeanDefinitionReader.java:320)
at org.springframework.beans.factory.
xml.XmlBeanDefinitionReader.loadBeanDefinitions
(XmlBeanDefinitionReader.java:290)
at org.springframework.beans.factory.
...


Pls help me out of this...
Syam
 
pioneer
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

they call the servlet 'springapp' and thus the .xml file 'springapp-servlet.xml' and they do put it in the WEB-INF directory.

see 1.6

Herman
 
Shyam kumar
pioneer
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok... I'll try it out and let you know if this works or not. By the way I'm using Spring 2.5 jars along with tomcat 5.0 and jdk1.4
Is this configuration ok? Iam aware that it is given in the step-by-step example that you need jdk 1.5 and tomcat 6.X
 
master steward
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Iam aware that it is given in the step-by-step example that you need jdk 1.5 and tomcat 6.X


I would follow the instructions to avoid unecessary hair pulling

And as Herman said, it is "springapp-servlet.xml", not "springDispatcher-servlet.xml". What name did you give to the DispatcherServlet in web.xml ? If you call it "springDispatcher", Spring will look for "springDispatcher-servlet.xml". So name the DispatcherServlet "springapp", as written in the tutorial.
 
Shyam kumar
pioneer
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Herman/Christopher, This problem is resolved by changing the sevleate name in web-xml.
 
pioneer
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and BTW the JDK 1.5 requirement is because later in the example they have used GENERICS. Otherwise, I was able to do the example using JRE 1.4 by using the 1.4 syntax.
 
Goodbye moon men. Hello tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!