aspose file tools*
The moose likes BEA/Weblogic and the fly likes Property files in the file-system instead of in the ear? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Property files in the file-system instead of in the ear?" Watch "Property files in the file-system instead of in the ear?" New topic
Author

Property files in the file-system instead of in the ear?

Mike Van
Ranch Hand

Joined: Apr 06, 2006
Posts: 83
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?


Mike Van
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.
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 813

Mike,

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.

Let us know if this works.


Regards, Sud.
SCJP 5 ScjpFAQ JLS
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Property files in the file-system instead of in the ear?
 
Similar Threads
log4j.properties file outside application
What is the best practice for property files outside the project EAR?
class conflict in jar and war
EAR deployment problem Weblogic Migration... additional resources needed on classpath
reading .properties file