4 Replies Latest reply on Oct 16, 2012 2:44 AM by Jean-Frederic Clere

    Context Parameter Override - AS 7.1

    avedal Newbie



      I've got a web application that gets deployed many times (once per customer).  The only difference between each deployment are things like JDBC datasource names, etc, which I store in a properties file.  The location of that properties file is stored in a context parameter defined in my web.xml.  That properties file location parameter is meant to overriden for each customer deployment.  In Tomcat, I would accomplish by specifying the parameters under the appropriate <context> element in server.xml.  How is this accomplished in JBoss AS 7.1?  I cannot find many options for tweaking context parameters according to the documentation.



      If it's not possible, then what is the best practice for dealing with this scenario?  I understand that I could create a separate WAR file for each deployment with the correct values for each deployment but I'd like to avoid that.

        • 1. Re: Context Parameter Override - AS 7.1
          Jean-Frederic Clere Master

          Just to make sure I get it right you run one instance of AS7.1 for each customer correct?

          • 2. Re: Context Parameter Override - AS 7.1
            avedal Newbie

            No, there is only one instance of AS 7.1.  There are N instances of my application running on the single AS 7.1 server instance. Thus, I have something like /myapp-cust1, /myapp-cust2, ..., /myapp-custN. 

            • 3. Re: Context Parameter Override - AS 7.1
              avedal Newbie

              To kind of explain further what we're doing today, we currently have an ANT task for each customer that fills in the appropriate customer-specific value for the properties file and then packages up the WAR file.  This means we deliver N-number of WAR files to the operations team to deploy.  When we get a new customer, it means adding a new ANT task for that customer.  Something about the whole process just feels wrong.  It's not currently possible to deploy this application if we get a new customer without involving the development team so that they can add the ANT task and build the WAR file.  It also means that the location of the properties file is something that is fixed once the WAR file is built unless the operations team wants unpack it, change the context parameter value, and then package it up again, but that also seems like a pretty bad practice.

              • 4. Re: Context Parameter Override - AS 7.1
                Jean-Frederic Clere Master

                That is the way to go, there isn't a server.xml in AS7

                Anyway changing a global for local webpp configuration doesn't look a good idea.