Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best practice for properties / configuration in JEE application

 
Markus Schmider
Ranch Hand
Posts: 132
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have to maintain a JEE application with a rather convoluted architecture. I urgently need to make some aspects configurable so that e.g. the address of a Messaging server can easily be changed after deployment of the application. Unfortunately I cannot only use JEE compatible means like <env-entry> in ejb-jar some classes are EJBs others not. So I have to come up with a own configuration file.
What is the best practise for this? Can you use e.g. Apache Commons Configuration in a JEE enviroment? I have not found any examples for this yet.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB specification does not mandate how changes should be made after an application has been deployed, so you will have to read the documentation of your EJB server to ascertain how this is done.

In order to comply with the specification, you can package your properties file in a deployment JAR, and accessed it with the getResource() or getResourceAsStream() methods of java.lang.Class.

Generally speaking, I would expect an application redeployment would be needed after you have uploaded a changed properties file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic