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

前端 未结 26 2447
栀梦
栀梦 2020-12-07 15:40

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

26条回答
  •  青春惊慌失措
    2020-12-07 15:55

    I had the same problem. I solved it by adding the Spring facet (File->Project Structure) for each relevant module, and then add the configuration files. For some projects (spring mvc), the config files where detected automatically. However, for a jar project, I had to add the configuration files manually.

提交回复
热议问题