• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
chamini prashakthi
Ranch Hand
Posts: 127
3
  • Mark post as helpful
  • send pies
  • 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?



 
Paul Clapham
Sheriff
Posts: 22834
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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: 127
3
  • Mark post as helpful
  • send pies
  • 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?
 
Tim Nachreiner
Ranch Hand
Posts: 61
1
  • Mark post as helpful
  • send pies
  • 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. 
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!