• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How do you separate Server configuration (urls, domains) properties from a Web Application?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I wanted to know if there is a way we can separate the server configurations away from a web application so that we may be free to deploy into any JBoss server without having to worry about server configurations during build time.

This is the situation. We have built a web application that deploys to four separate JBoss instances, and each server has its own set of configurations that are required by the web application. Ideally, I would like to house those configurations on each JBoss server (ideally as a properties or xml), and somehow have the web application read those values (they would be string values similar to those from a properties file) from the server it is deployed against without having to build the application 4 different times. I have thought about using JNDI, but I do not know to implement it without having to place the values within the env-entry tags within the jboss-web.xml/web.xml which defeats the purpose of what I am trying to do.

Our application is a standard J2EE application that uses the following technologies.

- JDK 1.6
- JBoss 5.1.0.GA

If there are any suggestions, please let me know.

Thanks,

Juan
 
J.C. Bustamante
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am wondering if I could build a SAR module that would take the properties, and place them within the JNDI as soon as the server starts. This way we can read the properties from the JNDI through our web application. I am hoping that this is not overkill. This way, the SAR is responsible only for configuration properties and getting them into the JNDI, and our web application would be responsible for running our application with configurations from the JNDI. If anyone has a different solution, please let me know.

Thanks,

Juan
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One possible way is to create a properties file and place it in the JBOSS_HOME/server/< servername>/conf folder of each of the JBoss instances where you have your application deployed. The JBOSS_HOME/server/< servername>/conf is by default available in classpath. So in your web application code, you can do something like:
 
I'm so happy! And I wish to make this tiny ad happy too:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic