报错内容
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dynamicFormContentServiceImpl': Unsatisfied dependency expressed through field 'mapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.cofe.ssm.mapper.base.CofeBaseMapper<com.cofe.common.pojo.DynamicFormContent>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.cofe.ssm.mapper.base.CofeBaseMapper<com.cofe.common.pojo.DynamicFormContent>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
spring配置
<bean class="tk.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.cofe.ssm.mapper"/>
<property name="markerInterface" value="com.cofe.ssm.mapper.base.CofeBaseMapper"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
<property name="properties">
<value>
mappers=tk.mybatis.mapper.common.Mapper,com.cofe.ssm.mapper.base.CofeBaseMapper
</value>
</property>
</bean>
接口
public interface CofeBaseMapper<T> extends BaseMapper<T>,IdsMapper<T>,Marker {
}
框架版本
spring 4.1.3.RELEASE
mybatis 3.2.8
mybatis.spring 1.2.2
tk.mybatis 3.3.8
配置参照官方文档来的,但是就是报错,找不到原因,求大佬帮助
@ Liuzh_533
昨晚解决了,把所有继承默认Mapper<T>的接口全部改成自定义的Mapper<T>接口就不会报错了,但是我记得以前的确可以混用版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。