javaweb-applicationsdeploymentweblogic-10.xjava-ee-5

How to deploy the same web application twice on WebLogic 11g?


We have developed a JEE5 web application (WAR) and running it in production under WebLogic 11g (10.3.5).

Now the same application should be deployed as separate applications for different customers (different URLs, different data) on the same WebLogic.

I managed the first part by setting different context roots after deployment for each of them.

But I have yet to make them use different datasources - and since I want to avoid customer specific builds, the persistence.xml is the same for all applications, thus also the persistence unit name.

What is the best setup for this scenario? Am I forced making separate builds and by that different WARs or do I have to separate Managed Servers or Domains wihtin the server or is there a better way to solve it?


Solution

  • It seems to me from what I saw in the Oracle documentation, that having several domains is the only way to separate data sources with the same persistence unit name - which is bad, since this basically means running two WLS in parallel.

    For this reason I decided to go with building individual WAR files (which I tried to avoid initially), to include customer-specific persistence.xml files and specifying customer-specific datasources in the WLS.