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

前端 未结 26 2241
栀梦
栀梦 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 16:10

    Make sure that your IntelliJ Idea (IDE) is aware of all the necessary spring configurations that your module is being inspected against.

    You can check this under

    File > Project Structure > Modules > [your project name in the right panel] > Spring

    Sometimes, we need to explicitly tell the IDE that the spring configuration is coming from a dependency (a jar present in your project classpath)

    0 讨论(0)
  • 2020-12-07 16:11

    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".

    0 讨论(0)
提交回复
热议问题