Action:Consider defining a bean of type ‘AdminPunishService‘ in your configuration. 解决办法

Action:Consider defining a bean of type ‘org.unreal.cloud.inner.AdminPunishService’ in your configuration. 解决办法 Descrip

Action:Consider defining a bean of type ‘org.unreal.cloud.inner.AdminPunishService’ in your configuration. 解决办法

Description:

Field adminPunishService in AdminPunishController required a bean of type ‘AdminPunishService’ that could not be found.

方法一:在启动类里加注解:
@ComponentScan(value = "org.unreal.cloud.inner.service.*")

但这样会导致http出问题,用postman测试时候报404:

{ “timestamp”: 1600761301783, “status”: 404, “error”: “Not Found”, “message”}…

方法二:在serviceimpl实现类里加注解@service即可。

总结:早上写了个新模块,结果忘记在实现类里加注解,去问大佬,大佬也没注意到,然后自己又试来试去最后才发现是个很低级的bug,以后不能再犯。

发布者:admin,转转请注明出处:http://www.yc00.com/web/1738336729a4039001.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信