• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i am getting the below exception.I was able to ran the sample example with annotations. But without them,i am getting the below exception
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/SpringMVCTutorial-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringMVCTutorial-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringMVCTutorial-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
I have all 3.0.0 Release jars in my eclipse.
can you please help with this. appreciate your quick help

Thanks,
SIreesha
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's your spring context file named? When you specify your DispatcherServlet in your web.xml, it assumes that it's named "<servlet-name-of-dispatcher-servlet>-servlet.xml".

I'm assuming yours is defined something like:

which looks for "SpringMVCTutorial-servlet.xml".

You can change your DispatcherServlet's servlet-name to match your context file, rename the context file to match the servlet-name of the DispatcherServlet, or specify the name of the context file using either the "contextConfigLocation" init-param (to specify the path and full name of the file) or "namespace" init-param (to specify a name other than the servlet-name) on the DispatcherServlet.
 
sirisha mullapudi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nathan.I just rechecked my xml name.By mistake i gave SpringMVCTutorial_servlet.xml instead of SpringMVCTutorial-servlet.xml. I have corrected it and now it is working fine. Thanks for the Quick Response.

Thanks,
Sireesha
 
reply
    Bookmark Topic Watch Topic
  • New Topic