Property files in the file-system instead of in the ear?
posted 3 years ago
I have an application that is deployed and working well using Spring injection with the spring-ejb-properties.xml file compiled into the .ear file. The problem is that we have a few properties that need to change on a regular basis. Because the properties are compiled into the ear, whenever a property changes, I need to do a new release of the .ear. This is resulting in a recurring chore that seems unnecessary. Other containers, such as Karaf, allow property files to be located in the container's directory structure, and the values contained therein are passed to Spring for injection by the .jar files that use them.
Is there a way to do this with Weblogic without writing some custom doo-dad that will read the file off of the system and pass it into the .ear file?
If at first you don't succeed, try, try again. Unless you really suck at it. Then, you might just want to try something else, if you dont' want to be a loser I mean.
there are many methods by which this can be achieved.
If the properties file is outside ear/war specify its location using vm properties
like -Dproperty.file.path=/root/yourproperties.properties and access that using Syetm.getProperty("property.file.path");
Also, if you put the property files into a JAR and put it into that lib directory, that should work.