Bug 535740 (RHQ-2404)

Summary: WAR/EAR file with context root of "/" causes duplicate ROOT.war to be inventoried
Product: [Other] RHQ Project Reporter: Mark Burchard <mburchar>
Component: InventoryAssignee: Ian Springer <ian.springer>
Status: CLOSED CURRENTRELEASE QA Contact: Jeff Weiss <jweiss>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.2CC: ccrouch, cwelton, dajohnso, ian.springer, mdimaio
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-2404
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:57:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 557793    
Attachments:
Description Flags
duplicate_ROOT.jpg
none
vhosts-test-2.war
none
vhosts-test-2.ear
none
JBoss JMX Management Console.htm
none
vhosts-test-3.war
none
RHQ-2404.patch none

Description Mark Burchard 2009-09-02 18:05:00 UTC
WAR/EAR file with content root of "/" causes duplicate ROOT.war to be inventoried.  Example screenshot and reproducer WAR/EAR attached.

Comment 1 Mark Burchard 2009-09-02 18:05:52 UTC
screenshot of duplicate ROOT.wars

Comment 2 Mark Burchard 2009-09-02 18:09:21 UTC
reproducer .WAR

Comment 3 Mark Burchard 2009-09-02 18:09:48 UTC
reproducer .EAR 

Comment 4 Charles Crouch 2009-09-02 22:17:21 UTC
(5:16:01 PM) ccrouch: mburchard: so what is the multiplying factor ?
(5:16:10 PM) mburchard: one per vhost

Comment 5 Charles Crouch 2009-09-02 23:20:15 UTC
Attached JBoss JMX Management Console.htm which doesnt show any similar duplication of mbeans

Comment 6 Charles Crouch 2009-09-02 23:35:06 UTC
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

Comment 7 Mark Burchard 2009-09-03 13:53:17 UTC
Case 322732

Comment 8 John Mazzitelli 2009-09-03 16:38:27 UTC
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?

Comment 10 John Mazzitelli 2009-09-03 18:54:20 UTC
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.


Comment 11 John Mazzitelli 2009-09-03 18:59:53 UTC
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.

Comment 12 Ian Springer 2009-09-03 19:24:54 UTC
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.


Comment 13 John Mazzitelli 2009-09-03 19:57:18 UTC
https://jira.jboss.org/jira/browse/JBAS-7227

Comment 14 John Mazzitelli 2009-09-11 16:29:21 UTC
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"




Comment 15 Ian Springer 2009-09-12 04:58:32 UTC
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).


Comment 16 Ian Springer 2009-10-12 13:49:27 UTC
Fixed in (git) trunk (10/12/09 @ 9:30am EST).


Comment 17 Charles Crouch 2009-10-12 15:53:30 UTC
commit	03f67f21299c5dd27987a9c1f0b0494d6bfc4d04
(I think this is the right hash)

Comment 18 Ian Springer 2009-10-12 19:03:36 UTC
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.


Comment 19 Ian Springer 2009-10-27 14:43:08 UTC
Fixed in Jopr 2.3 CP branch - Jopr r1239.


Comment 20 Corey Welton 2009-11-09 21:31:42 UTC
Latest fix received appears to resolve this duplicate ROOT.war issue.


Comment 21 Red Hat Bugzilla 2009-11-10 21:03:47 UTC
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)


Comment 22 Corey Welton 2010-01-26 14:57:52 UTC
qa -> gneelaka

Comment 23 Jeff Weiss 2010-02-01 17:08:50 UTC
QA Verified.  Deploying  vhosts-test-2.ear shows only one ROOT.war.  Linux/oracle, r5276

Comment 25 Corey Welton 2010-08-12 16:57:35 UTC
Mass-closure of verified bugs against JON.