Error creating bean with name 'XXX': Injection of autowired dependencies failed error solution

Problem Description:----------------------------------------

Class injection failed: When restarting the server after changing the code, the following error is reported

 Error creating bean with name'com.space.portal.interceptor.LoginInterceptor#0': Injection of autowired dependencies failed :


Cause: ---------------------------------------

1: The class name is wrong, 2: The package name is wrong

Among them: Most likely, the class name is not annotated with @Service

There are many ways to report this error

Mine is because the package name is wrong, so spring can't map it,,,,,,,,

Error creating bean with name 'itemController': Injection of autowired dependencies failed:

The second time I reported this error because I forgot to add the @Service annotation to the implementation class that inherited the interface

Solution:---------------------------------------

First, check whether the name is wrong, and then check whether all Service classes are annotated with @Service

Below I have also collected several possible reasons

https://blog.csdn.net/qq_31823265/article/details/53816663

https://blog.csdn.net/a411358606/article/details/54426424

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325789010&siteId=291194637