在使用SpringBoot装配mybatis时出现了异常

***************************
APPLICATION FAILED TO START
*************************** Description: Field studentService in com.example.demo.action.StudentController required a bean of type 'com.example.demo.service.StudentService' that could not be found. The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true) Action: Consider defining a bean of type 'com.example.demo.service.StudentService' in your configuration. Process finished with exit code 0

查了一下,大意是因为我的StudentService没有被SpringBoot的自动装配扫描到,解决办法就是在SpringBootApplication类上加一行注解指定需要被装配的Service包

Like this:

@ComponentScan(basePackages = {"com.example.demo.service"})
public class SpringBootApplication {

最新文章

  1. Python爬取代理ip
  2. Windows 8 下离线安装。net Framework 3.5
  3. JQuery学习之Ajax应用
  4. ubuntu 图形界面查看隐藏文件
  5. Net开发环境配置
  6. xmodem, ymodem & zmodem
  7. head tail 命令
  8. lucene分词多种方法
  9. # void :;
  10. VMware Workstation 11安装
  11. [AH/HNOI2017]大佬
  12. Microsoft Store应用安装路径和应用推荐——如何用Linux命令操控windows
  13. 常用VIM插件配置
  14. k64 datasheet学习笔记3---Chip Configuration之Times
  15. GitHub上README.md教程 详情介绍 (修改图片连接地址错误)
  16. kettle(一) 安装全过程
  17. JAVA Iterator 转成 List
  18. 应用程序添加角标和tabBar添加角标,以及后台运行时显示
  19. modelsim仿真中Altera库的用法
  20. MongoDB安装笔记

热门文章

  1. Fiddler 基础
  2. easyui的combobox默认选中第一个选项
  3. K2 BPM_携手东航物流,领跑全球航空物流业_全球领先的工作流引擎
  4. 03.Zabbix应用服务监控
  5. 十九,基于helm搭建EFK日志收集系统
  6. seaborn图形
  7. vue-element-admin后台的安装
  8. PAT乙级1042
  9. HTML5——3 HTML5拖放
  10. 【CF1218E】Product Tuples