J'essaie de créer un monde de salut avec le printemps sur l'éclipse. Mais je reçois l'erreur suivante:Bonjour le monde avec le printemps
INFO: Loading XML bean definitions from class path resource
[src/com/spr/main/contextApplication.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [src/com/spr/main/contextApplication.xml]; nested exception is java.io.FileNotFoundException: class path resource [src/com/spr/main/contextApplication.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
at com.spr.main.Main.main(Main.java:15)
Caused by: java.io.FileNotFoundException: class path resource [src/com/spr/main/contextApplication.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:141)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
... 4 more
J'ai essayé:
XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("\\src\\com\\spr\\main\\contextApplication.xml"));
et
XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("\\src\\com\\spr\\main\\contextApplication.xml"));
et le chemin de contextApplication.xml est src/com/spr/main/
Quel est le code qui donne l'erreur? –