J'ai un projet Maven avec Spring. J'ai un projet backend comme jar dans le classpath (ajouté en tant que dépendance maven). Le projet backend est à nouveau avec Spring et possède son propre applicationContext.xml. Dans le projet frontend je applicationContext.xml et je veux accéder au contexte d'application de tha back-end comme celui-ci:Impossible de trouver applicationContext.xml à partir de jar dans classpath
<import resource="classpath:applicationContext.xml" />
mais je suis:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:applicationContext.xml]
Offending resource: ServletContext resource [/WEB-INF/appContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
essayé aussi:
<import resource="classpath*:applicationContext.xml" />
et
<import resource="classpath:/applicationContext.xml" />
est-applicationContext.xml dans src/main/ressources? – Derek
Oui. Dans le projet backend (pot) c'est là. Dans la FE (où je veux utiliser celui du pot) c'est dans WEB-INF –