Bug 642732 - Web Application Context Availability reports DOWN when JBoss Web is started with host name other than localhost
Web Application Context Availability reports DOWN when JBoss Web is started w...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
All All
low Severity medium (vote)
: ---
: ---
Assigned To: Stefan Negrea
Mike Foley
:
Depends On:
Blocks: jon30-bugs
  Show dependency treegraph
 
Reported: 2010-10-13 12:47 EDT by Larry O'Leary
Modified: 2013-09-02 03:14 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-02 03:14:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBPAPP-5260 Major Resolved Web Application Context is not registering ComponentType{type=MBean, subtype=WebApplicationManager} in ProfileService wh... 2013-06-24 17:36:37 EDT

  None (edit)
Description Larry O'Leary 2010-10-13 12:47:35 EDT
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:
Always

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:

JBOSS_HOME=/opt/jboss/eap/jboss-eap-5.0.1/jboss-as
hostName=my.real.hostname.redhat.com
configProfile=default
jbossWebConfig=${JBOSS_HOME}/server/${configProfile}/deploy/jbossweb.sar/server.xml
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 13:43:26 EDT
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 14:34:06 EDT
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 19:00:15 EDT
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"
        class="org.jboss.profileservice.management.ProxyManagedDeploymentFactory">
        <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"/>
                    </property>
                </bean>
                <!-- WebModule -->
                <bean class="org.jboss.profileservice.management.ProxyDeploymentInfo">
...

Specifically:

 <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:

      JBOSS_HOME=/opt/jboss/eap/jboss-eap-5.1.0/jboss-as
      JBOSS_CONF=default
      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 11:20:17 EST
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 08:38:23 EST
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 09:48:58 EST
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 03:14:04 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.

Note You need to log in before you can comment on or make changes to this bug.