<pre name= "code" class= "java" > Org.springframework.beans.factory.BeanCreationException:Error creating Bean With Name ' com.hft.dal.mapper.AccountMapperTest ':
injection of autowired dependencies failed; nested exception Org.springframework.beans.factory.BeanCreationException:
could not autowire field:private Com.hft.dal.mapper.AccountMapper Com.hft.dal.mapper.AccountMapperTest.accountMapper;
Nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:No matching bean of type [ Com.hft.dal.mapper.AccountMapper] found for dependency:
After the inspection found
@ContextConfiguration (locations = {"Classpath:spring-mybatis.xml", "Classpath:applicationContext.xml"})
Classpath in the middle of a more space, resulting in no scan to the Spring-mybatis.xml configuration file, note also if the use of classpath* if not to find a dozen profiles will ignore the error, So if you are sure that there is only one configuration file that uses Classpath