autowired爆红
时间: 2024-03-14 21:14:34 浏览: 51
使用Spring2.5的Autowired实现注释型的IOC
回答: 当使用@Autowired注解时,有时会出现爆红的情况。这可能是因为idea提示你需要注入一个非空的对象。解决这个问题的一个简单方法是按住alt + enter,然后选择Edit inspection profile setting。另外,你也可以尝试将@Autowired注解换成@Resource注解,这是JDK中的注解,不会像@Autowired那样去Spring容器中寻找bean。\[1\]\[3\]
#### 引用[.reference_title]
- *1* [@Autowired下的爆红怎么解决](https://blog.csdn.net/m0_58347801/article/details/127611621)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [@Autowired注解爆红原因及解决方法](https://blog.csdn.net/weixin_47331155/article/details/121890957)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [SpringBoot中@Autowired爆红原理及解决方案(转载)](https://blog.csdn.net/qq_43649223/article/details/118827060)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文