小工具知识网

当前位置: 首页 > 行业知识 > 运行springboot出现“A component required a bean of type...that could not be found“问题

行业知识

运行springboot出现“A component required a bean of type...that could not be found“问题

2026-11-08 12:47:52 来源:互联网转载

 问题:

相关报错如下:

***************************

APPLICATION FAILED TO START

***************************

Description:

A component required a bean of type 'index.php/tags-1038.html" >org.com.mapper.UserMapper' that could not be found.

Action:

Consider defining a bean of type 'org.com.mapper.UserMapper' in your configuration.

解决办法:

一:

查看导入的@Mapper是否正确

二:

 1.给主类XXXApplication加注解@MapperScan("包名.mapper文件夹名")

 2. pom.xml文件的build节点下加入如下代码:

                                     src/main/java                                    **/*.properties                    **/*.xml                    **/*.yml                                false                                        src/main/resources                                    **/*.properties                    **/*.xml                    **/*.yml                                false                        

上一篇:网络打印服务器怎么连接的?

下一篇:探索易语言源码,揭开数字世界的宝藏之谜!