5 Replies Latest reply on Oct 28, 2009 9:21 AM by Alberto Marchi

    same war, different config

    Alberto Marchi Newbie

      I have one war file with my application. I want to deploy it in jboss with different names,like

      Application1.war
      Application2.war
      ApplicationN.war

      each app should use a different config file, to find which database to use.

      How I can do that ? I did this on jboss AS on the developement pc, with windows, by creating a

      ApplicationN.war.config file, and opening it.

      But now that i deploy on linux, jboss will unzip the war, and the application lose the connection to the original war, so I have problems finding the config.

      Which is the best solution for this pattern ?

      thank you!

        • 2. Re: same war, different config
          jaikiran pai Master

           

          "iltrex" wrote:

          But now that i deploy on linux, jboss will unzip the war, and the application lose the connection to the original war, so I have problems finding the config.


          You can deploy your application in exploded format to prevent such the server from unzipping the war http://www.jboss.org/community/wiki/ExplodedDeployment


          • 3. Re: same war, different config
            Alberto Marchi Newbie

             

            "jaikiran" wrote:
            "iltrex" wrote:

            But now that i deploy on linux, jboss will unzip the war, and the application lose the connection to the original war, so I have problems finding the config.


            You can deploy your application in exploded format to prevent such the server from unzipping the war http://www.jboss.org/community/wiki/ExplodedDeployment


            I know, but this is something that I want to avoid.
            It would be very confortable to deploy 100 applications that are identical, just copying ONE single war file together with its own config file.

            I really wonder if the only official way to have the same WAR with different config files is to create different wars... I would really not like it.

            I hope that the requirement is clear.

            alberto

            • 4. Re: same war, different config
              Ales Justin Master

               

              "iltrex" wrote:

              each app should use a different config file, to find which database to use.

              Which is the best solution for this pattern ?

              I would rather handle this programatically, than deploy N identical apps.

              e.g. make ConnectoionPool context aware, via ThreadLocal


              • 5. Re: same war, different config
                Alberto Marchi Newbie

                 

                "alesj" wrote:
                "iltrex" wrote:

                each app should use a different config file, to find which database to use.

                Which is the best solution for this pattern ?

                I would rather handle this programatically, than deploy N identical apps.

                e.g. make ConnectoionPool context aware, via ThreadLocal


                Using one single war for all application is not the desired solution for three reasons

                1) we have to deploy applications on different servers, and it must be easy to move an application from a server to another if it's usage increase
                2) versioning: we want to be able to give different version to different customers ( for example, beta testers)
                3) writing a multi-database application in one single application is error-prone, we prefer to have one single application deployed many times.

                alberto