[英]Spring beans unresolved in IntelliJ
I started a project with IntelliJ that worked well but did something that broke it. 我与IntelliJ一起开始了一个项目,该项目效果不错,但做了一些破事。 Here is my applicationContext.xml file.
这是我的applicationContext.xml文件。
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="foo.Bar" />
</beans>
When inspecting the file I get the error 检查文件时出现错误
Cannot resolve bean 'foo.Bar'
无法解析bean'foo.Bar'
The same thing happens for all classes I try to put in my spring configuration file. 对于所有尝试放入spring配置文件中的类,同样的事情也会发生。 Any clue about that ?
有什么线索吗?
Here are the screenshots : 这是屏幕截图:
spring file error : https://drive.google.com/file/d/0BwhIWYS5TjDRaWxjUzhBbDVnNk0/view?usp=sharing 春季文件错误: https : //drive.google.com/file/d/0BwhIWYS5TjDRaWxjUzhBbDVnNk0/view?usp = sharing
spring facet : https://drive.google.com/file/d/0BwhIWYS5TjDRb1RHbGlCOW9xeTg/view?usp=sharing 弹簧面: https : //drive.google.com/file/d/0BwhIWYS5TjDRb1RHbGlCOW9xeTg/view? usp =sharing
I use Maven to import jars and the classes exist in my classpath. 我使用Maven导入jar,并且类存在于我的类路径中。 But the code assist doesn't give me any tip when I edit the bean class property.
但是,当我编辑bean类属性时,代码辅助并没有给我任何提示。
Without a screenshot of IntelliJ its hard to find out, but here is my shortlist: 没有IntelliJ的屏幕截图,很难找到,但是这是我的候选清单:
1) did you configure the IntelliJ Spring facet to include your xml file? 1)您是否已将IntelliJ Spring方面配置为包括xml文件? To check that, hit F4 while selecting the root of the project tree and see the Facet configuration for Spring.
要进行检查,请在选择项目树的根目录时按F4键,然后查看Spring的Facet配置。 There your xml file must be listed.
必须列出您的xml文件。
2) you really have package "foo" with the Class "Bar.java" under your "sources" folder in IDEA ? 2)您真的在IDEA的“ sources”文件夹下有类“ Bar.java”的“ foo”包吗?
Without full log-trace, I can only make assumption on why this is happening 没有完整的日志跟踪,我只能假设为什么会发生这种情况
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.