Solution to the prompt “could not autowire. No beans of ‘XXXX’ type found” in IntelliJ idea

1. Problem description

In idea’s spring project, you often encounter the error prompt of course not autowire. No beans of ‘XXXX’ type found. However, there is no problem with the compilation and operation of the program, and this error prompt will not have an impact. But the red error prompt is more or less uncomfortable in the eyes of some OCD programmers.

 

 

2. Reasons

        There may be two reasons. The first is the problem of IntelliJ idea’s own tools. The second is caused by the import package error when we import the @ service package

3. Solutions

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

 

  Look at the solved problems:

 

  Reference article: https://www.cnblogs.com/expiator/p/8991545.html

Similar Posts: