2 Replies Latest reply on Dec 9, 2007 1:19 PM by jfrankman

    How to handle configurable properties.

    jfrankman Novice

      When I deploy my applications as an EAR there are certain properties that must change based upon the runtime environment such as the port of the Naming service or Production/Test environment settings. Basically those types of things normally put in a properties file. What is the best way to handle environment properties for my EAR applications?

      Right now I see three approaches:
      1. Use a regular old properties file and unzip EAR
      2. Use a regular old properties file and deploy exploded EAR
      3. putting some jndi bindings in the jboss-service.xml file

      The problem I see with 1 is that if I had to make changes, I would have to unzip the EAR, make the change, and then re-zip it up. I want to be able to make configuration changes without disrupting the application.

      Option 2 looks promising, but I am not sure if I change a value in the properties file when the EAR application will recognize the value change.

      I have settled on option 3, but I think this requires that I restart JBoss whenever I make a change to the bindings. Is there a better way to handle environment properties? I want to know what my options are so I can do some more research, but for now I am not sure where to start.

      Thanks,

      James

        • 1. Re: How to handle configurable properties.
          Elias Ross Master

          For 2 and 3 you can "touch" the application.xml to get JBoss to re-deploy.

          You can use system properties, e.g. ${network.bind.address} in your ejb-jar.xml file.

          • 2. Re: How to handle configurable properties.
            jfrankman Novice

            Thanks for the reply. I have a few more questions.

            1. By "touch" do you mean open the file, make a change, and save it?

            2. Is there an easy way to adjust the properites file if it is in a "zipped" ear file?

            3. When I make a change to the applications.xml file does it redeploy the entire .ear? If so, is the application redeployment transmarent to end users, or is the applicaiton unavailable while the redeployment is in progress?

            4. Would you recomment options 1,2, or 3? Or is using the ejb-jar.xml file the best option?