WAR/EAR file with content root of "/" causes duplicate ROOT.war to be inventoried. Example screenshot and reproducer WAR/EAR attached.
screenshot of duplicate ROOT.wars
reproducer .WAR
reproducer .EAR
(5:16:01 PM) ccrouch: mburchard: so what is the multiplying factor ? (5:16:10 PM) mburchard: one per vhost
Attached JBoss JMX Management Console.htm which doesnt show any similar duplication of mbeans
Lets see if we can get a fix in for this since its a bug a customer hit and it should be trivial to reproduce/test. Just have the ROOT.war deployed as it is by default and create another virtual host and you should get two ROOT.war Webapp resources. If its a quick, simple fix we'll do it otherwise, it will go in the next release
Case 322732
what is the exact replication steps? do you just have to copy one of the attached war/ear to the deploy/ directory of a JbossAS 4.2 server and the problem shows up?
http://wiki.unixcraft.com/display/MainPage/Application+Virtual+Hosts
This might not be our fault - it may in fact be correct. JBoss deploys MBeans for each vhost and context-path pair in this pattern (these are the MBean ObjectNames): jboss.web:host=<hostname>,path=<context-path>,type=Manager Look at the attached JMX console html and you will see three of them (I see this too on my box): jboss.web:host=snert.home.bsd.de,path=/,type=Manager jboss.web:host=snert.home.pilhuhn.de,path=/,type=Manager jboss.web:host=localhost,path=/,type=Manager This tells me that JBoss is telling us that the context-path of "/" (of which ROOT.war will be handling) is on three vhosts (the three host= values). Thus, the three ROOT.war resources - one per vhost. Each WAR for each vhost gets its own Resource in inventory. This is how it is supposed to work, as I read the code and understand it.
This is working as expected. JBoss is informing us that there are three vhosts with a .war to handle the context path of / (ROOT.war) - thus the three ROOT.war resources.
Then I think this is a JBAS bug. There should only be vhost MBeans for a given context root, if the WAR corresponding to that context root defines those vhosts in its jboss-web.xml. In the case of ROOT.war, it does not define any vhosts in its jboss-web.xml, so it should only have one vhost MBean registered for it corresponding to the default vhost (localhost). We should leave this JIRA open and create a JBAS bug and link it as a dependency.
https://jira.jboss.org/jira/browse/JBAS-7227
from Jason Greene via JBAS-7227: "We can't change the mbean definitions in 4 as they would break compatibility. They way we handled the vhost information in 5 was to use type=Host, instead of type=Manager, This information is also there in 4"
After more investigation, it turns out this is a bug in the AS4 plugin's WAR discovery code, not a bug in JBAS. The attached patch (to Jopr r1186) provides a fix. It eliminates the duplicate WAR Resources in inventory that were occurring when the same context root was defined in multiple WARs. In the case of vhosts-test-2.war, the "/" context root is defined in both vhosts-test-2.war (for the two "*.de" vhosts) and ROOT.war (for the "localhost" vhost). In the case of vhosts-test-3.war, the "/jmx-console" context root is defined in both vhosts-test-3.war (for the two "*.de" vhosts) and jmx-console.war (for the "localhost" vhost).
Fixed in (git) trunk (10/12/09 @ 9:30am EST).
commit 03f67f21299c5dd27987a9c1f0b0494d6bfc4d04 (I think this is the right hash)
I'm leaving this open, because I still need to check the fix into the 2.3 CP branch in order to build a patch for a customer. I am waiting on Greg to migrate the CP branches to git, so I can check the fix in to git, rather than SVN.
Fixed in Jopr 2.3 CP branch - Jopr r1239.
Latest fix received appears to resolve this duplicate ROOT.war issue.
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2404 Imported an attachment (id=368789) Imported an attachment (id=368790) Imported an attachment (id=368791) Imported an attachment (id=368792) Imported an attachment (id=368793) Imported an attachment (id=368794)
qa -> gneelaka
QA Verified. Deploying vhosts-test-2.ear shows only one ROOT.war. Linux/oracle, r5276
Mass-closure of verified bugs against JON.