我使用spring并且无法读取Spring.xml文件。 ApplicationContext context = new ClassPathXmlApplicationContext(“Spring.xml”);向我显示此错误:引起:java.io.FileNotFoundException:类路径资源[Spring.xml]无法打开,因为它不存在
我建议使用Maven生成一个新项目。回答你的问题重构你的项目如下,它将能够在类路径上找到xml
src/main/java
- 所有课程
src/main/resources
- 所有配置,属性,xml等