views:

530

answers:

2

We have a typical J2EE application:

  • ear
    • war A
    • war B
    • domain jar
    • datasource config
    • ejb.jar
      • EJBs
      • JPA config

We use jBoss as our J2EE container. The same application must be deployed multiple times into the same container (in order to support different independent customers). This is proving to be a troublesome and error prone task since a variety of settings must be changed; in multiple xml files; spread throughout the structure above.

Does anyone have any advice on how these repeat deployments can be simplified?

A: 

Per your current description, I see no reason as to why exactly you need to redeploy the same application to support multiple customers.

Can you please elaborate as to what exactly you are doing and why you believe it is necessary to redeploy your app again and again?

Either way, something you are doing sounds wrong.

Yuval A
It's seems pretty natural if you handle different BDs for different customers. I mean: limited, managed customers that need an application instance for each one (I know you could rephrase the app but maybe it's easier to install diferent configurations)
helios
This is a comment, not an answer
Peter Hilton
+2  A: 

For each of the EARs that you need to deploy separately, create a set of property/configuration files.

For example, if you have customer A and customer B, create (as examples):

  • customerADatabase.properties
  • customerBDatabase.properties
  • customerASomeOtherConfig.xml
  • customerBSomeOtherConfig.xml
  • etc.

Then use ant or maven to script the creation of separate ear files for customer A and B, using the different properties files. You should be able to script it so that at the end of your build process, you have

  • customerA.ear - with customerADatabase.properties and customerASomeOtherConfig.xml
  • customerB.ear - with customerBDatabase.properties and customerBSomeOtherConfig.xml

As @Yuval A points out, however, this may not be the best solution...now if you have some changes to make to properties/configuration, you have to change a lot of files...

Michael Sharek