当我尝试运行简单的弹簧示例时,我遇到了异常
以下代码行尝试从 beans1.xml 读取 spring beans
ApplicationContext context = new ClassPathXmlApplicationContext("beans1.xml");
以下是我得到的完整例外。
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [beans1.xml]; nested exception is java.io.FileNotFoundException: class path resource [beans1.xml] cannot be opened because it does not exist
我已将 xml 文件放在每个可能的位置,希望该程序能够检测到该文件。但是这个程序仍然找不到这个bean配置文件。我也使用 maven 作为构建工具,但我使用 Eclipse IDE 运行程序