尝试在独立 Java 中读取 applicationContext.xml 时出错


ApplicationContext context=new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
InvGroupDelegate  igcd = (InvGroupDelegate) context.getBean("invGroupDelegate");

给出错误:

Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:157)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)

appContext 文件存在于 myProject/Properties 中 这也被添加到"构建路径中的 Src 文件夹"中。

解决了。是一个日食问题。关闭项目并重新操作。然后清理了一切并再次建造。然后一切都很好。

相关内容

  • 没有找到相关文章

最新更新