Bug 642732

Summary: Web Application Context Availability reports DOWN when JBoss Web is started with host name other than localhost
Product: [Other] RHQ Project Reporter: Larry O'Leary <loleary>
Component: PluginsAssignee: Stefan Negrea <snegrea>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0CC: lkrejci, snegrea
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 07:14:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 625146    

Description Larry O'Leary 2010-10-13 16:47:35 UTC
Description of problem:
The Web Application Context of a deployed/inventoried web application shows a state/availability of DOWN. The web application itself shows an availability of UP. This happens when JBoss Web of AS is started with its host name set to the physical host name rather then the default of localhost.

Version-Release number of selected component (if applicable):
JON 2.4.0.GA / jopr-jboss-as-5-plugin-3.0.0.GA.jar

How reproducible:

Steps to Reproduce:
1. Default/stock installation of JON 2.4
2. Default/stock installation of EAP 5.0.1
3. To the EAP installation, modify the host name property in the service.xml of JBoss Web:

sed -i 's/<Engine name="jboss.web" defaultHost=".*">/<Engine name="jboss.web" defaultHost="'${hostName}'">/g' "${jbossWebConfig}"
sed -i 's/<Host name=".*">/<Host name="'${hostName}'">/g' "${jbossWebConfig}"

4. Start EAP using the default profile
5. Start JON server and agent
6. Import the EAP instance into JON
7. Navigate to JBossAS Server (JBossAS5 plugin) -> my.real.hostname.redhat.com:1099 default -> Applications -> Web Application (WAR) -> ROOT.war -> Web Application Context -> /my.real.hostname.redhat.com

Actual results:
/my.real.hostname.redhat.com web application context shows an availability of DOWN even though it is UP.

Expected results:
/my.real.hostname.redhat.com web application context should show an availability of UP.

Additional info:
This is not limited to ROOT.war. It appears to impact all web applications. The cause of the DOWN state is because ProfileService returns no managed components of type ComponentType{type=MBean, subtype=WebApplicationManager} when the getComponentsOfType(ComponentType) method is invoked.

This issue appears to be with ProfileService/AS and not actually in the plug-in so an upstream bug will probably need to be filed.

Comment 1 Larry O'Leary 2010-10-13 17:43:26 UTC
Missed this in the description but here is the error you see in the agent log if debug logging is enabled:

Failed to find [ComponentType{type=MBean, subtype=WebApplicationManager}] ManagedComponent named [jboss.web:host=my.real.hostname.redhat.com,path=/,type=Manager]

Comment 2 Larry O'Leary 2010-10-18 18:34:06 UTC
This issue appears to be a problem in ProfileService of EAP/AS. Logged       JBPAPP-5260 in upstream.

Comment 3 Larry O'Leary 2010-10-25 23:00:15 UTC
The missing componentType from ProfileService is due to ${JBOSS_HOME}/server/${JBOSS_CONF}/deploy/profileservice-jboss-beans.xml scoping the Manager bean to a specific host:

    <bean name="WarManagedDeploymentFactory"
        <property name="factoryName">War</property>

        <property name="defaultViewUse">STATISTIC</property>
        <property name="rootMOPatterns">
            <set elementClass="org.jboss.profileservice.management.ProxyDeploymentInfo">
                <!-- Manager -->
                <bean class="org.jboss.profileservice.management.ProxyDeploymentInfo">
                    <property name="compType">MBean</property>
                    <property name="compSubtype">WebApplicationManager</property>
                    <property name="pattern">jboss.web:host=localhost,type=Manager,*</property>
                    <property name="nameBuilder">
                        <inject bean="WarManagerMBeanDeploymentNameBuilder"/>
                <!-- WebModule -->
                <bean class="org.jboss.profileservice.management.ProxyDeploymentInfo">


 <property name="pattern">jboss.web:host=localhost,type=Manager,*</property>

Changing this to:

 <property name="pattern">jboss.web:type=Manager,*</property>

Resolves this issue and additionally allows a WebModule deployed to one or more vhosts to appear in ProfileService as well.

Here is a sed command which will fix this:

      sed -i.orig 's/^.*<property name="pattern">jboss\.web:.*,type=Manager,\*<\/property>$/                    <property name="pattern">jboss.web:type=Manager,*<\/property>/g' "${JBOSS_HOME}/server/${JBOSS_CONF}/deploy/profileservice-jboss-beans.xml"

Comment 4 Larry O'Leary 2011-03-07 16:20:17 UTC
The AS fix has been committed upstream on AS 6.0 and also will be included in EAP post 5.1 (i.e. 5.1.1, or > 5.1).

Comment 5 Stefan Negrea 2011-11-11 13:38:23 UTC
I just tested the reported problem with EAP5.1.1 and I cannot replicate it. The issues has been resolved on EAP side. 

This BZ does not require any change in RHQ code. Please retest.

Comment 6 Lukas Krejci 2011-11-25 14:48:58 UTC
Confirmed that this issue seems to have been fixed in EAP 5.1.1. The context is shown as unavailable in EAP 5.1.0 but is correctly shown as UP in EAP 5.1.1 with identical configuration.

Putting this to verified as there are no code changes on our side.

Comment 7 Heiko W. Rupp 2013-09-02 07:14:04 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.