File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Spring in Action this week in the Spring 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: 823

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
 
Don't get me started about those stupid light bulbs.
 
subject: Property files in the file-system instead of in the ear?