Bug 893217 - [as5 plugin] Unable to collect metric from web application context due to WebApplicationContextComponent not initializing 'clustered' property value
[as5 plugin] Unable to collect metric from web application context due to Web...
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 5 (Show other bugs)
JON 3.1.1
All All
urgent Severity high
: ER01
: JON 3.2.0
Assigned To: Larry O'Leary
Mike Foley
: Regression
Depends On: 905183
Blocks: 905186
  Show dependency treegraph
Reported: 2013-01-08 17:36 EST by Larry O'Leary
Modified: 2014-01-02 15:34 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 894188 905183 905186 (view as bug list)
Last Closed: 2014-01-02 15:34:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Screenshot (104.78 KB, image/png)
2013-10-21 09:21 EDT, Sunil Kondkar
no flags Details

  None (edit)
Description Larry O'Leary 2013-01-08 17:36:17 EST
Description of problem:
Web application context metrics are not being collected and result in an NPE. This is a regression from JBoss ON 3.1.0. The metrics that seem to be affected are:

rejectedSessions, sessionMaxAliveTime, sessionCounter, expiredSessions, maxActive, sessionAverageAliveTime, activeSessions

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Install and start EAP 5.1.2 server using all profile
2.  Start JBoss ON system
3.  Import EAP server into inventory
4.  Navigate to the *Monitoring* page of the //localhost/jxm-console web application context:

        <platform> / JBossAS Servers / EAP <host:port> all / Applications / Web Application (WAR)s / jmx-console.war / Web Application Contexts / //localhost/jmx-console > Monitoring 

5.  Enable the metric *Currently Active Sessions* and set its collection interval to 1 minute

It may take several minutes for the new value to take affect. It may simply be quicker to restart the agent at this point so that you can be certain that the new collection schedule will take affect.
Actual results:
No metrics appear in JBoss ON UI and agent logs the following error each time metric collection is attempted:

ERROR [ResourceContainer.invoker.daemon-5] (org.rhq.plugins.jbossas5.WebApplicationContextComponent)- Failed to collect metric 'activeSessions' for {JBossAS5}Web Application Context Resource with key localhost.
	at org.rhq.plugins.jbossas5.WebApplicationContextComponent.getValues(WebApplicationContextComponent.java:146)
	at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:634)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)

Expected results:
Metrics should be collected normally and UI should reflect metrics.

Additional info:
This is a direct result of commit http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=88c286048d73a963eb2e2debd1009d8ed0d595b0 from bug 837510 is what breaks this. Prior to this commit, the variable clustered was initialized. However, this commit changed the type to an object without being initialized resulting in <null> being the default value whereas the existing code does not expect this. It appears that the initialization and retrieval of the web application context's clustered property was re-factored resulting in a non-initialized variable being used when attempting to retrieve the mentioned metrics.
Comment 1 Larry O'Leary 2013-01-08 18:20:41 EST
Proposed fix based on master is on branch bug/893217 as commit http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?h=bug/893217&id=540d85287d3811cfea581e474b600f85ee7b4217.
Comment 2 Larry O'Leary 2013-01-28 14:20:36 EST
Committed to master: http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=4403c93e9f56274644f397174582a0540c0195fc

commit 4403c93e9f56274644f397174582a0540c0195fc
Author: Larry O'Leary <loleary@redhat.com>
Date:   Tue Jan 8 16:59:11 2013 -0600

    Bug 905183 - [as5 plugin] Unable to collect metric from web application context due to WebApplicationContextComponent not initializing 'clustered' property value
    Added code to verify that clustered has been initialized and if it has not, an attempt is made to initialize it. Additionally, it will not be used if it is not initialized.
Comment 3 Sunil Kondkar 2013-10-21 09:20:48 EDT
Verified on Version: 3.2.0.ER3 Build Number: c0742ed:90dd474

Installed and started EAP 5.1.2 server using all profile. Followed the steps and verified that the metrics for 'Currently Active Sessions' are collected and UI reflects the metrics. Please refer the attached screenshot.
There are no errors in agent log.
Comment 4 Sunil Kondkar 2013-10-21 09:21:57 EDT
Created attachment 814601 [details]

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