We have a problem that we want to deploy the same EAR on multiple servers.
It is not necessarily a cluster, and we even have
two application servers on the same physical machine.
Now each EAR needs slightly different configuration parameters, e.g. each must use its own data source/connector to a legacy system, which can not handle more than 30 connections.
So how would you configure the applications when you do not want to deploy different EARs.
Things considered so far:
1) Put the configuration into global DB/JNDI, but then
each application must know on which server it is
currently running. Is this possible in a portable way?
2) Start each server instance with a unique system property
3) Have a "per server" configuration directory (yes, I know
should not be done with J2EE)
Thanks for any comments
Victor, I've seen the same issue. In our case, we had IBM MQ reply queues that had the name of the machine in them. We solved that with a global AppServer environment variable that was defined for every appserver.
Another option that might sit better with you, would be a solution using #1. I can think of two ways to identify where you are. 1. InetAddress.get...(). However, if you vertically cluster that won't work. 2. Use JNDI to determine what appserver you are in. This probably isn't portable, but with WebSphere, you can traverse the tree and determine what AppServer you are in. This allows you to pick the configuration for your specific appserver.
If these do or don't help, reply here...