-
May 13th, 2008, 10:03 AM
#1
nested exception is java.io.FileNotFoundException: applicationContext.xml
I am newbie AOP. I try to write a simple codes to test in Eclipse.
public class MainApp {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
ApplicationContext atx = new FileSystemXmlApplicationContext("applicationContex t.xml");
IBusinessLogic testObject = (IBusinessLogic)atx.getBean("businesslogic");
testObject.foo();
}
}
<bean id="businesslogic" class="org.springframework.aop.framework.ProxyFact oryBean">
<property name="proxyInterfaces">
<value>IBusinessLogic</value>
</property>
<property name="target">
<ref local="beanTarget"/>
</property>
</bean>
<bean id="beanTarget" class="zhong.BusinessLogic">
</bean>
Error:
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionSt oreException: IOException parsing XML document from file [D:\eclipseworkshop\Aop\applicationContext.xml]; nested exception is java.io.FileNotFoundException: applicationContext.xml (The system cannot find the file specified)
Caused by: java.io.FileNotFoundException: applicationContext.xml (The system cannot find the file specified
Thanks for help!!!
-
May 13th, 2008, 10:52 AM
#2
Specifiy complete path to applicationContext.xml if you are loading through FileSystemXmlApplicationContext class. If you are loading through ClassPathXmlApplicationContext make sure the applicationContext.xml is in classpath (add package dirs like com/test/applicationContext.xml if you have package on your class).
-
May 14th, 2008, 06:43 PM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules