Consider revisiting the entries above or defining a bean of type *** that could not be found

编程知识 更新时间:2023-05-02 05:30:45

现象

程序启动是报错

16:58:47.845 ERROR 11524 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

A component required a bean of type 'xxx' that could not be found.

The following candidates were found but could not be injected:
	- xxx resulted in false


Action:

Consider revisiting the entries above or defining a bean of type xxx in your configuration.

Disconnected from the target VM, address: '127.0.0.1:51851', transport: 'socket'

Process finished with exit code 1

分析

未找到需要引用的类

解决方案

  1. 确认pom中引入了该类jar包;
  2. Spring初始化是否会扫描该类所在的目录,非启动目录可以使用ComponentScan加入启动扫描;
  3. Spring是否对该类实现进行了初始化加载,实现类上是否使用了Component、Service等初始化加载标签。

更多推荐

Consider revisiting the entries above or defining a bean of type *** that could

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

发布评论

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

>www.elefans.com

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

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