Announcement Announcement Module
Collapse
No announcement yet.
nested exception is java.io.FileNotFoundException: applicationContext.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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!!!

  • #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).

    Comment


    • #3
      thx, i got it.

      Comment

      Working...
      X