2 Replies Latest reply on Feb 26, 2009 10:43 PM by Pedro Sena

    Multiple application instances

    Dave Sunerton-Burl Newbie

      I've posted over on the JBoss forums, but I thought I'd ask here as well... I have a Seam application which needs to be deployed many times on the same server under different context roots and each one needs to use a different datasource. So, essentially, I have many different (and separate) instances of exactly the same application - they're just all using different data. I can easily set up a build process to churn out a full EAR for a specific context/datasource but the trouble is, the number of instances is going to get large - upwards of 50. Is it possible to configure JBoss to deploy multiple instances of the same application (i.e. from one single EAR/WAR) under different context roots and somehow include instance parameters which I can get hold of (with EL in components.xml??) to configure each application instance?


      Perhaps I'm not thinking about this the right way? Any suggestions would be appreciated...

        • 1. Re: Multiple application instances
          Nikos Paraskevopoulos Novice

          Hello,


          Indeed you can deploy separate instances of the same application. One thing you need to consider is versioning: Will all these instances (both framework/libraries and your own code) be of the same version and upgraded uniformly, or might you be needing different versions? Will there be any customizations that make the code of some instances differ from that of others?


          If all instances have one version, you want to upgrade them uniformly, there are no code customizations and no singletons, you can even make JBoss share the framework and application classes to save some memory. Deploy application-level jars in server/CONF/lib, then use them from your EARs/WARs.


          If however there may be differences between the deployed apps, you need to make certain that each app uses a different classloader. See docs for jboss-app.xml on how to do this.


          I would suggest you utilize ant's filtering capabilities for customizing the configuration of each app. See ant's docs, eg search for filters in Core Tasks->Copy. Of course the EARs (or WARs) need to have different names too.

          • 2. Re: Multiple application instances
            Pedro Sena Newbie

            May I ask you WHY are you doing this?


            I suppose that you have a SaaS scenario where each client has one schema in the database.


            Am I wrong?


            In this case I have a 'better'(more scalable) solution for this scenario.


            Just tell me if this interests you.


            Regards,


            Pedro Sena