解决Injection of autowired dependencies failed的报错

错误:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxxxxx': Injection of autowired dependencies failed;

原因:

错误显示就是Spring不能自动装配xxxx,看了好久才发现错误。

今天引入一个dubbo消费者,它的接口名字和一个老的接口名字是一样的,只不过不在同一包下,但是默认名字就相同了,

我在写service层注入了这个dubbo接口,spring就找不到到底是哪一个接口了。项目中的dubbo消费者太多了,没注意看啊啊啊。。。

相关错误都有可能是这种忘记装配啦,重名了之类的,不要慌,好好排查一下,多踩点坑也是种进步吧。

环境:SSM框架,idea开发环境

猜你喜欢

转载自blog.csdn.net/lcgoing/article/details/84980158