我正在尝试在Spring中创建我的第一个bean,但在加载上下文时遇到了问题。我在src/main/resources中有一个bean的配置XML文件。
我收到以下IOException:
线程"main“org.springframework.beans.factory.BeanDefinitionStoreException:在解析来自类路径资源src/
/ IOException /beans.xml的XML文档时出现异常;嵌套异常为
java.io.FileNotFoundException:无法打开类路径资源src/main/resources/beans.xml,因为它不存在
但是我不明白,因为我做了下面的代码测试:
File f = new File("src/main/resources/beans.xml");
System.out.println("Exist test: " + f.exists());
这就是事实!resources
在类路径中。怎么了?
https://stackoverflow.com/questions/12893760
复制相似问题