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文件夹中。
答案 0 :(得分:0)
解决了它。是一个日食问题。关闭项目并重新开始。然后清理一切并再次构建。事情很好。