用eclipse實現老師代碼的問題,bean文件無法注入
下到了老師給的源碼,是用MyEclipse建的項目,把applicationContext.xml放在了WebContent/WEB-INF/config/目錄下,然后再JUnit測試用@ContextConfiguration("classpath:**/application*.xml")諸如配置文件,報錯
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.ce.spring.transaction.demo1.SpringDemo1': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'accountService' is defined
這是我的項目結構
2017-02-12
不要將配置文件放到WEB-INF下面,不再classpath上
2016-06-13
classpath:applicationContext.xml (對應的xml文件名)
2016-06-13
路徑問題
,改成這樣應該就好了