Can a EAR have more than one WAR project in it ?


General J2EE: Can a EAR have more than one WAR project in it ?

  1. Can a EAR have more than one WAR project in it ? (5 messages)

    Suppose we have 2 modules say Admin and Employee which are big and therefore need to be seperated into 2 different WAR projects.

    Can an EAR be a place holder to 2 WAR then ?

    Threaded Messages (5)

  2. Yes[ Go to top ]

  3. Its possible however[ Go to top ]

    There should not be any cross-dependency between the WAR files
  4. 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.

  5. It seems 2 webapps aren't allowed the same context root - on Weblogic Server 8.1 and it threw an InstanceAlreadyExistsException at deploy time.
  6. 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.

    Bill Lasley
    Versant Corp.