Error creating bean with name 'xxx': Injection of resource dependencies failed的解决办法

问题

运行项目的后端代码,出现如下错误:
在这里插入图片描述
即:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘signInController’: Injection of resource dependencies failed;
nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name ‘signInService’: Bean with name ‘signInService’ has been injected into other beans [signInService] in its raw version as part of a circular reference, but has eventually been wrapped.
This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using ‘getBeanNamesOfType’ with the ‘allowEagerInit’ flag turned off, for example.

解决

可以看到“signInService”、“circular reference”,说明应该是signInService的调用出现了问题,出现了“自己调用自己”的情况。再仔细看看SignInServiceImpl,发现它调用了自己的接口层SignInService,所以出错了。
在这里插入图片描述

收获

遇到问题莫要慌,仔细看看问题,看看它在说啥,静下心来就能解决啦~向雅雯姐比心ღ( ´・ᴗ・` )

猜你喜欢

转载自blog.csdn.net/qsbbl/article/details/89403483
今日推荐