This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 905186 - [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...
Status: CLOSED NEXTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 5 (Show other bugs)
JON 3.1.2
All All
urgent Severity high
: ER01
: JON 3.1.3
Assigned To: Larry O'Leary
Mike Foley
: Regression
Depends On: 893217
Blocks: 894188
  Show dependency treegraph
 
Reported: 2013-01-28 14:28 EST by Larry O'Leary
Modified: 2013-09-05 22:24 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 893217
Environment:
Last Closed: 2013-09-05 22:24:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Larry O'Leary 2013-01-28 14:28:53 EST
+++ This bug was initially created as a clone of Bug #893217 +++

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):
4.4.0.JON311GA

How reproducible:
Always

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.
java.lang.NullPointerException
	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.

--- Additional comment from Larry O'Leary on 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.

--- Additional comment from Larry O'Leary on 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 1 Larry O'Leary 2013-01-28 14:34:09 EST
Committed to release/jon3.1.x: http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=d424355d2d79746a63cf326629777e004378b0ed

commit d424355d2d79746a63cf326629777e004378b0ed
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.
    (cherry picked from commit 4403c93e9f56274644f397174582a0540c0195fc)
Comment 2 Larry O'Leary 2013-09-05 22:24:39 EDT
Closing as there will not be a 3.1.3 release. This is being tracked for 3.2 in the 'depends on' field.

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