严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'routeDetailServiceImpl': Unsatisfied dependency expressed through field 'routeDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.daqiang.travel.dao.routeDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
这里在整合spring和mybatis时遇到的一个坑,由于一开始我想快速的搞掂,所以没有进行分步测试,在使用spring进行依赖注入时,其中有一个步骤是扫描mapper接口,这里的mapper是接口而不是xml
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer" >
<property name="basePackage" value="cn.daqiang.travel.dao"></property>
</bean>