salut
j'arrive pas a compilé un exemple sur l'utilisation de framework spring que j'ai trouvé dans un tutoriel , de coup cette erreurs m'apparaitre :
pour lire le fichier xml j'ai fait ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 27 oct. 2008 13:34:15 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [spring-config-01.xml] Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring-config-01.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring-config-01.xml] cannot be opened because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73) at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61) at spring01.test.main(test.java:13) Caused by: java.io.FileNotFoundException: class path resource [spring-config-01.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:142) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) ... 4 more
le fichier spring-config-01.xml ce trouve dans la racine de projet .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 final XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("spring-config-01.xml"));
merci d'avance pour votre aide
Partager