springboot2.x 集成了通用mapper tk.mybatis
在启动类使用了tk.mybatis.spring.annotation.MapperScan @MapperScan("thinkme.demo.mapper")
各种设置都正常,换成原始的mybatis就没问题。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'itemMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'thinkme.demo.mapper.ItemMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
搞定了,定义的mapper接口名称重复冲突