Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mike Van
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic