spring注解方式 idea报could not autowire
来源:互联网 发布:众筹系统源码 编辑:程序博客网 时间:2024/06/08 01:12
解决办法1:
从根本上解决:
File-Project Structure 页面 Facets下删掉 Spring(直接右键Delete)
这个解答是对的。并不会降低安全性!!
因为创建项目的时候,都是先创建空项目再创建web moduele(你想直接创建web project也可以),一般不会使用spring组件。都是自己配置的。
这时候你要是不小心手滑(手滑原因:因为idea对你spring的配置文件会在上方报警告,然后你一fix,就容易出事),那就会报错无法Autowired。
所以你只要删掉你手滑添加的就可以
http://www.oschina.net/question/202626_181237
解决办法2:
降低Autowired检测的级别,不要提示就OK
tellij Idea @Autowired取消提示
Spring bean通过@Autowired注入,spring auto scan配置,在编辑情况下,无法找不到对应的bean,于是提示找不到对应bean的错误。
但build项目是能正常运行的。
可在File -- Settings -- Inspections。使用搜索功能 找到 Autowired for Bean Class ,
将Severity的级别由之前的error改成warning或其它可以忽略的级别。
阅读全文
0 0
- spring注解方式 idea报could not autowire
- spring注解方式 idea报could not autowire
- spring注解方式 idea报could not autowire
- spring注解方式 idea报could not autowire
- spring注解方式 idea报could not autowire,eclipse却没有问题
- spring注解方式 idea报could not autowire,eclipse却没有问题
- spring注解方式intellij idea报could not autowire,eclipse却没有问题
- IDEA下Spring项目报错-could not autowire. no beans of“” type found
- intellij Idea报错Could not autowire. No beans of...
- Idea 注解错误could not autowire no beans of...plicationEventMulticaster not initialized
- 解决Idea 出现 "Could not autowire.." 错误
- could not autowire field 错误解决方式
- 新手学习spring boot,遇到@Autowired报Could not autowire field错误
- Could not autowire解决方法 INtellij IDEA @Autowired取消提示
- IDEA在编辑时提示could not autowire
- IDEA在编辑时提示could not autowire
- IDEA在编辑时提示could not autowire
- IDEA在编辑时提示could not autowire
- Windows自动登录账户密码(By Modify 注册表)
- 规则通道组和注入通道组
- PAT
- 常见安全漏洞及整改建议[备忘]
- docker学习笔记一
- spring注解方式 idea报could not autowire
- Android 动态申请权限 (解决:open failed: EACCES (Permission denied))
- 超链接<a></a>
- 使用WinHttp接口实现HTTP协议Get、Post和文件上传功能
- 从MongoDB抽取数据导入mysql
- Java多线程的悲观锁与乐观锁
- 转:设计模式之----,命令模式
- 从零开始搭建SSH 框架
- 知识点-多条目加载(代码)