公司的配置文件在同级scr的config里面。
本人象测试service方法.可是老拿不到applicationContext.xml这个文件!
-src
--测试代码
<ApplicationContext ctx = new ClassPathXmlApplicationContext("/Sample02/config/applicationContext.xml");>
-config
--applicationContext.xml

解决方案 »

  1.   

    /Sample02/config/applicationContext.xml
    中的sample02应该是工程名吧,不算做源代码的一部分。
    应该用config/applicationContext.xml,前面不要加/
      

  2.   

    获得你的项目根路径
    然后“项目根路径”+"/Sample02/config/applicationContext.xml"
      

  3.   

    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [config/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [config/applicationContext.xml] cannot be opened because it does not exist
    at 
      

  4.   

    找到解决办法了. 运行的是class下的applicationContext.xml
    所以只要写 /applicationContext.xml 就行了。。