admin管理员组文章数量:1026989
springboot 出现 Consider defining a bean of type 'xxx' in your configuration解决方案
1.检查自己写的注解是否错了,没有see down。
2.在网上查找解决方式:如下所示:
步骤一:
在springboot的配置文件添加,mybatis的配置如下所示:
mybatis:
typeAliasesPackage: com.xxx.xxx.dao.entity
mapperLocations: classpath:mapper/*.xml
步骤二:
1、在启动类上加上@MapperScan或者@ComponentScan注解,手动指定application类要扫描哪些包下的注解,如下所示:
@SpringBootApplication@ComponentScan(basePackages = {"com.xxx.xxx.dao"})
2、或者在接口上添加@Mapper注解。
@Mapper
public interface UserMapper {
}
springboot 出现 Consider defining a bean of type 'xxx' in your configuration解决方案
1.检查自己写的注解是否错了,没有see down。
2.在网上查找解决方式:如下所示:
步骤一:
在springboot的配置文件添加,mybatis的配置如下所示:
mybatis:
typeAliasesPackage: com.xxx.xxx.dao.entity
mapperLocations: classpath:mapper/*.xml
步骤二:
1、在启动类上加上@MapperScan或者@ComponentScan注解,手动指定application类要扫描哪些包下的注解,如下所示:
@SpringBootApplication@ComponentScan(basePackages = {"com.xxx.xxx.dao"})
2、或者在接口上添加@Mapper注解。
@Mapper
public interface UserMapper {
}
本文标签: 解决方案BeandefiningSpringBootConfiguration
版权声明:本文标题:springboot出现Consider defining a bean of type ‘xxx‘ in your configuration解决方案 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1738335496a1562613.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论