Consider defining a bean of type ‘com.xg.stupro.service.StudentService‘ in your configuration.

编程知识 更新时间:2023-05-02 05:31:07

1、运行sprring boot项目时,出现这个错误:Consider defining a bean of type 'com.xg.stupro.service.StudentService' in your configuration.

2、百度了一下,说是运行spring boot的Application类没有跟相关的service层放在同个包或者在其父包底下,找不到这个service,后面发现确实有这个问题,于是把Application类放在com.xg.stupro底下,发现还是不行。

3、最后发现原来忘记加了在Service类底下忘记加了@Service注解,加了便可以了。

4、又是细节决定成败。。。

更多推荐

Consider defining a bean of type ‘com.xg.stupro.service.StudentService‘ in your

本文发布于:2023-04-26 06:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/278eaf52009daa803665a93c06cfe92f.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:type   xg   defining   bean   StudentService

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 104568文章数
  • 26215阅读数
  • 0评论数