Each ear, war, ejb-jar file (or exploded directory) is considered a uniquely-identifiable component by a J2EE server. The context root isn't what identifies the wars the the server, it is web uri.
To put it in simple terms, if you deployed a war directly to the JBoss deploy directory instead of via an ear, you couldn't "deploy" it twice because you can't put the same file into a directory twice and have two different things of that name appear in the directory - there would only be one war in it of that name. Same thing with the uri.
The confusion probably from thinking of this as being like adding a jar to a classpath; understandable, but that isn't what is going on here. As far as the server is concerned, the fact that your two war files are identical except for the name is completely unknown to it. It assumes that the deployment information is potentially different, and they definitely require their own sets of resource factories, connection pools, etc.
Reid - SCJP2 (April 2002)
Joined: Dec 15, 2005
thx for the answer.
I want this solution because we are using /adusr for Active Directory login and /usr for our own login implementation. We use apache as frontend and we have configured /adusr to point to AD authentification and /usr for own implementation. The same war file is used.