5 Replies Latest reply on Oct 16, 2006 9:45 AM by trebiani

    Multiple deployments of same application

    larsbj

      I've ran into a problem, and I find it kind of hard to explain, but I'll give it a try:

      We have an J2EE-application deployed as an ear-archive. The app consists of a servlet which accepts and sends XML to the clients. The servlet accesses a few EJBs through a facade. The database is Postgresql. The servlet is mapped to http://ourserver/application

      Now we have to deploy the same application for multiple customers in the same JBoss-instance. For security and privacy reasons the applications cannot access the same database.

      I'd like to be able to:
      * Create the usual ear-archive (non-customer-specific)
      * Change the mapping of the servlet to
      http://ourserver//application
      * Change the the datasource in jboss.xml to
      a customer specific datasource
      * Change the name of the ear to application-customer.ear
      * Deploy it

      If I do the above can I deploy multiple instances of the same ear (ie. just change the name of the ear and do the above edits in the config-files) without risking trouble with caching of beans etc.

      Since the beans are defined as ejb/ (ie. ejb/user) etc., will they interfere with each other, so I can risk getting customer A's data in Customer B's application etc?

        • 1. Re: Multiple deployments of same application

          This is ok.
          You seem to have a handle on what changes you need to
          make.

          Here's a link if you don't already know about it.

          http://www.jboss.org/online-manual/HTML/ch07.html

          You need to avoid sharing jndi names, the caching/pooling
          is done per application.

          Regards,
          Adrian

          • 2. Re: Multiple deployments of same application
            pepito

            I am having problems with this type of setup too.

            I have an entety bean that is confusing data and that is saving itself to 2 databases...

            I am trying different things in my code to make sure I am not the one screwing up.... but I am starting to think there might be a bug or something....

            • 3. Re: Multiple deployments of same application
              agentblueuk

              has anyone got this to work ? we want to do the exact same thing to allow us to provide our application as a hosted solution for our clients without the need for multiple jboss instances

              • 4. Re: Multiple deployments of same application
                trebiani

                hi!

                this seems to be an unresolved problem. i ran into the same problem with my application and could not find a "clean" (or perfect) solution for it.

                right now i'm running multiple instances of jboss - which is quite memory consuming :-(

                the other option would be a different jndi names for all ejb's, datasources, security context, etc. - but a new ear for _every_ customer? i'm thinking of modifying my xDoclet build process to change every jndi name during build. but here is the next problem: think about a small bug and hundreds of installations: then i have to make hundreds of ear files with different jndi names ......

                any help would be appreciated!
                treb

                • 5. Re: Multiple deployments of same application
                  trebiani

                   

                  "trebiani" wrote:
                  this seems to be an unresolved problem. i ran into the same problem with my application and could not find a "clean" (or perfect) solution for it.


                  well, i found a lot of postings: i searched for postings from agentblueuk ;-)
                  it is definitely not so easy to solve and should be addressed while designing the application. it's quite hard to change the application design afterwards.

                  i will try it with xDoclet and ANT Properties substitution and will post the results here.