IntelliJ IDEA在使用Spring的@Autowired注释时显示错误 [英] IntelliJ IDEA shows errors when using Spring's @Autowired annotation

查看:3550
本文介绍了IntelliJ IDEA在使用Spring的@Autowired注释时显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在类中使用Spring的@Autowired批注时,IntelliJ IDEA显示错误,但是该类可以正常运行.

IntelliJ IDEA is showing errors when I use Spring's @Autowired annotation in the class, but the class is functioning without any problem.

这是此错误消息:

必须在有效弹簧中定义自动装配的成员 豆(@ Component/@ Service等)少...(Ctrl + F1)检查自动装配 bean类中的问题.

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

推荐答案

我在IntelliJ IDEA 13.1.4中遇到了相同的问题 我通过删除Spring构面(文件"->项目结构")并将其保留为仅显示检测"来解决它.

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

这篇关于IntelliJ IDEA在使用Spring的@Autowired注释时显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆