Results 1 to 3 of 3

Thread: nested exception is java.io.FileNotFoundException: applicationContext.xml

Hybrid View

  1. #1
    Join Date
    May 2008
    Posts
    10

    Default 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. #2

    Default

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

  3. #3
    Join Date
    May 2008
    Posts
    10

    Default

    thx, i got it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •