springboot 踩坑日志 02-mybatis-plus 在dao中添加select报错
Error creating bean with name ‘accountServiceImpl’: Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘accountMapper’ defined in file [D:\Projects-Java\SGBasketServer\target\classes\com\shuguo\dao\AccountMapper.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ibatis.annotations.Select.databaseId()Ljava/lang/String;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660)
问题分析
导入了mybatis-spring-boot-starter 和 mybatis-plus 依赖
解决方案
去掉mybatis 然后把 mybatis-plus 改为mybatis-plus-boot-starter即可