• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException

 
Ranch Hand
Posts: 181
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm new to spring and at the beginning code I faced to a problem.
I can't figure it out why?

this is my java code with main method


this is Triangle class


this is my spring.xml file



and this is my file structure,
springtest
  drawingApplication.java
  Triangle.java
  spring.xm
l

so finally t gives this error.

INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@6267c3bb: startup date [Sun Oct 29 06:33:45 IST 2017]; root of context hierarchy
Oct 29, 2017 6:33:45 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist


can some one explain it  why and provide me a solution?



 
Marshal
Posts: 27531
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, here's the relevant part of the stack trace:

java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist



Clearly your spring.xml file exists, because you've posted it. Which would mean you haven't put it in the place where Spring expects to find it. So you'd need to find out where that is, and put a copy of the file there.
 
chamini prashakthi
Ranch Hand
Posts: 181
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I checked it by moving my xml file inside the packages of the code and also the outside the packages.But any one didn't give me a solution.
Why is that?
I an't figure out the correct folder?
 
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm guessing you are viewing the Java Brains tutorial for Spring.  What you are looking for is located at this link:  https://www.youtube.com/watch?v=7c6ZTF6cF88&list=PLC97BDEFDCDD169D7&index=4
at the 5:00 minute mark in the video.  
 
reply
    Bookmark Topic Watch Topic
  • New Topic