spring-injection.xml放在哪里,UnitTestBase是如何找到它的?
報錯:?IOException parsing XML document from class path resource [spring-injection.xml]; nested exception is java.io.FileNotFoundException:
class path resource [spring-injection.xml] cannot be opened because it does not exist
應該怎樣存放?
2016-05-12
一般放在與包同級目錄下,在類里使用ClassPathXmlApplicationContext cpx=new?ClassPathXmlApplicationContext("spring-injection.xml")找到;getBean("beanId")獲取配置好的注入對象