IntelliJ IDEA reported Could not autowire. No beans of'xxxx' type found

created at 09-12-2021 views: 1198

1. Problem description

In Idea’s spring project, I often encounter the error message

Could not autowire. No beans of'xxxx' type found. 

However, there is no problem with the compilation and operation of the program, and this error message will not have an impact. But the red error hints are more or less uncomfortable in the eyes of some programmers with obsessive-compulsive disorder.

Could not autowire. No beans of'xxxx'

2. Reason

There may be two reasons. The first is the problem of IntellijIDEA's own tools. The second one is caused by the import package error when we import the @Service package.

3. Solution

For the first reason, the solution is: lower the level of Autowired detection, and change the level of Severity from the previous error to warning or other negligible levels.

lower the level of Autowired detection

Look at the solution:

problem solved

created at:09-12-2021
edited at: 06-04-2022: