IntelliJ IDEA is showing errors when I use Spring\'s @Autowired
annotation in the class, but the class is functioning without any problem.
Here is this
Remove .iml file from all your project module and next go to File -> Invalidate Caches/Restart
I fixed it by adding the supress warning:
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Autowired
private ....
You should check if you have @Component, @Repository or similar added on the class
I had similar problem. I solved it by unchecking "Process explicitly annotated beans" option (see screenshot below). This option is enabled by default on linux. Now @Service and @Configurations annotations are visible. screenshot
I might be a little late, but after spending hours and researching on this issue.
I found out that in the latest version IntelliJ 2020 @AutoWired is optional and constructor based depedency injection is preferable.
I sloved the problem by simply removing the @AutoWired Annotation from Service and Controller class and using constructor based dependency injection.
This link might help.
Happy Coding!
I've solved this problem this way. In IntelliJ all of your packages should be in a sub package which is the sub package of main/java. For example I've put all of my packages under src/main/java/com.misisol.watchStore/ and spring could find my beans then after.