Bug 676721

Summary: When no partition name is defined in AS instance, metric collection results in NPE
Product: [Other] RHQ Project Reporter: Larry O'Leary <loleary>
Component: PluginsAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
EAP 5.0.1 running with default profile JON 2.4 using JBoss AS 5 Plug-In
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Larry O'Leary 2011-02-10 22:31:16 UTC
If I run JBoss EAP/AS default profile - so no partition name is specified then JON GUI will show "nothing found" in "Cluster Partition Name" but agent log file will be filled up with the exceptions like:

ERROR [ResourceContainer.invoker.daemon-9] (org.rhq.plugins.jbossas5.ApplicationServerComponent)- Failed to obtain metric 'MCBean|ServerConfig|*|partitionName'.
java.lang.NullPointerException
	at org.rhq.plugins.jbossas5.util.ManagedComponentUtils.getSimplePropertyValue(ManagedComponentUtils.java:83)
	at org.rhq.plugins.jbossas5.ApplicationServerComponent.getMetric(ApplicationServerComponent.java:544)
	at org.rhq.plugins.jbossas5.ApplicationServerComponent.getValues(ApplicationServerComponent.java:248)
	at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)


If we run JBoss EAP/AS using "all" or "production" profile then this exception is not logged (even if we don't specify partition name as an argument) and in this case JON will show "DefaultPartition" as "Cluster Partition Name". If we run JBoss with the specified partition name then this will be taken as "Cluster Partition Name" - and all this seems fine (no exceptions in the log file).

...

This appears to be related to Bug 594520 and JBPAPP-4541. The problem is, the NPE should just not be logged in the event that the AS instance is returning a null object or the object could not be found.