十四洲 2022-09-29 17:28 采纳率: 37.5%
浏览 44
已结题

后端springboot搭建的报错

问题遇到的现象和发生背景

报错idea

运行结果及报错内容
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-09-29 17:17:07.178 ERROR 9716 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

A component required a bean of type 'com.example.onedemo.mapper.UserMapper' that could not be found.


Action:

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


Process finished with exit code 0

运行结果及报错内容

想学springboot来做毕设但是学着学着四不像,哭了。这个是跟学的文章https://blog.csdn.net/xqnode/article/details/113079010?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166443922716782391833416%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=166443922716782391833416&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-113079010-null-null.142^v51^pc_rank_34_queryrelevant25,201^v3^add_ask&utm_term=springboot%E9%9B%86%E6%88%90mybatis%E4%BF%9D%E5%A7%86%E7%BA%A7&spm=1018.2226.3001.4187
我不知道为什么报错,哭了,根本不会

  • 写回答

3条回答 默认 最新

  • 莪是男神 2022-09-29 17:39
    关注

    启动类上加个@MapperScan(value = "mapper类的位置")

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 10月7日
  • 已采纳回答 9月29日
  • 创建了问题 9月29日

悬赏问题

  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入