@Autowired fails with JUnit & Spring
问题 Really need help. I used JUnit(4.6) plus Spring(3.0.5) for unit testing. When I tried to autowire a service object in my test class, I got a NoSuchBeanDefinitionException. The JUnit code: package com.aaa.service.impl; @ContextConfiguration(locations = { "classpath:/spring/applicationContext.xml", "classpath:/spring/applicationContext-aop.xml", "classpath:/spring/applicationContext-dao.xml", "classpath:/spring/applicationContext-service.xml" }) @RunWith(SpringJUnit4ClassRunner.class) public