3

I have two Java applications which use Spring (one with v 2.5.4, the other with v 3.1.1.) and are deployed onto Weblogic.

For each application, I'd like Spring to be able to utilise two separate property files - one in the server's filesystem and, if that does not exist for any reason, one included in the application's ear file as a set of "default" values.

Can I specify such a thing using a "context:property-placeholder" entry in the application's applicationContext.xml file?

I've had a look on the Net and not been able to find anything definitive... but could I do something like this, for example?

<!-- Default values loaded first -->
<context:property-placeholder location="classpath:myEarPropertiesFile.properties" />
<!-- Overridden values loaded next -->
<context:property-override location="file:myExternalPropertiesFile.properties" />

Thanks in advance for any thoughts.

GarlicBread
  • 1,671
  • 8
  • 26
  • 49
  • Not answering your question. These two versions of spring jars are very different. But I have run into lot of exceptionInitialize errors. If possible, try to keep them apart. – sathish_at_madison Aug 03 '12 at 01:45
  • Have you checked : http://stackoverflow.com/questions/3035630/how-to-achieve-conditional-resource-import-in-a-spring-xml-context – HRgiger Aug 03 '12 at 02:56

1 Answers1

1

I managed to fix the issue with a PropertiesFactoryBean which was referenced by my PropertyPlaceholderConfigurer.

GarlicBread
  • 1,671
  • 8
  • 26
  • 49