General J2EE: Can a EAR have more than one WAR project in it ?
Suppose we have 2 modules say Admin and Employee which are big and therefore need to be seperated into 2 different WAR projects.
- Posted by: anand mandhre
- Posted on: February 28 2005 05:50 EST
Can an EAR be a place holder to 2 WAR then ?
- Yes by adrian osullivan on February 28 2005 06:32 EST
- Can a EAR have more than one WAR project in it ? by anand mandhre on February 28 2005 08:01 EST
There should not be any cross-dependency between the WAR files
So guys this could mean that certain pages invoked by the user could come from a different WAR right ? What about the context root ? Can they both have same context root ?
Also shouldn't one WAR act like a entry point and all request go via it so that we can isolate logging, security, filter etc at one location.
It seems 2 webapps aren't allowed the same context root - on Weblogic Server 8.1 and it threw an InstanceAlreadyExistsException at deploy time.
Yes, pages are served from the web module in which they are contained. The context root must be unique. Some application servers associate a web module to a virtual host. If the web modules are deployed to different virtual hosts, then they can have the same context root. Of course, the context root must be unique for both virtual hosts. Assuming your application server supports it, and your application architecture permits it, perhaps the easiest solution to your final question would be to change your WAR class loading policy to Application. Or, logging could be accomplished through shared classes in a dependent jar.