Salut,
1° La stacktrace c'est :
1 2 3 4 5 6
| org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'bagadManager' defined in class path resource [spring/services-applicationContext.xml]: Could not resolve placeholder 'proxy.useProxy'
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:287)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:638)
... |
Par rapport à ta réponse, le PropertiesFactoryBean remontera une exception si le fichier proxy n'est pas trouvé, non ? Je n'ai pas vu d'équivalent aux "ignore*" du Placeholder.
Pour le deuxième cas, c'est à peu près ce que j'ai aujourd'hui, mais du coup je n'ai pas d'erreur lorsque le fichier ws n'est pas trouvé.
2° Fichier B (security-applicationContext.xml) :
<context:property-placeholder location="classpath:proxy.properties" ignore-resource-not-found="true" ignore-unresolvable="true" />
Fichier A (services-applicationContext.xml) :
1 2 3
| <bean id="x" class="x">
<property name="ipProxy" value="${proxy.ip}" />
</bean> |
web.xml :
1 2 3 4 5 6 7
| <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/spring/services-applicationContext.xml
classpath:/spring/security-applicationContext.xml
</param-value>
</context-param> |
Mais comme je disais, des beans de B sont, eux, correctement injectés dans des beans de A. Il n'y a que pour le fichier properties que ça pose problème.
Partager