IntelliJ IDEA shows errors when using Spring's @Autowired annotation

Vainlyh picture Vainlyh · Jan 24, 2014 · Viewed 102.4k times · Source

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 error message:

Autowired members must be defined in the valid spring bean (@Component/@Service,etc.) less... (Ctrl+F1) Checks autowiring problems in a bean class.

Answer

Jose Leon picture Jose Leon · Jan 19, 2015

I had the same problem with IntelliJ IDEA 13.1.4 I solved it by removing the Spring facet (File->Project Structure) and leaving it to just show "Detection".