Hi all,
I am trying to run a sample Dependency Injection code from Spring in Action Book's chapter 1. The application that sets the ball rolling is -
But when I try to run the code, I get this exception -
Feb 21, 2008 9:51:40 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [C:\Workspace\springTest\knight.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file [C:\Workspace\springTest\config\knight.xml]; nested exception is java.io.FileNotFoundException: config\knight.xml (The system cannot find the file specified)
Caused by: java.io.FileNotFoundException: config\knight.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:297)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
at com.springinaction.chapter01.knight.KnightApp.main(KnightApp.java:14) Please let me know where should I put my knight.xml. I am using this file just to inject some dependencies into the Knight object.
What are other ways of loading these XML? The folder structure that I am using is -
springTest/src/*.java are placed
springTest/knight.xml
[ February 21, 2008: Message edited by: Niranjan Deshpande ]