Bug 848135

Summary: NullPointerException during discovery for [Cache] Resources, EAP5.1.2
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: PluginsAssignee: Heiko W. Rupp <hrupp>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: high    
Version: JON 3.1.1CC: fbrychta, hrupp, jsanda
Target Milestone: ---   
Target Release: JON 3.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 848030 Environment:
Last Closed: 2013-09-03 11:14:12 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 848030    
Bug Blocks:    

Description Heiko W. Rupp 2012-08-14 14:07:21 EDT
+++ This bug was initially created as a clone of Bug #848030 +++

Created attachment 604267 [details]
agent log

Description of problem:
$Summary

Version-Release number of selected component (if applicable):
Version: 3.1.1.ER2
Build Number: f546515:4eb3f2c

How reproducible:
Always

Steps to Reproduce:
1. clean installation of JON with jon-plugin-pack-eap-3.1.1.ER2 prepared and running
2. EAP5.1.2 is running with 'all' profile (./run.sh -c all)
3. import eap resource
  
Actual results:
2012-08-14 13:11:18,400 WARN  [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failure during discovery for [Cache] Resources - failed after 1 ms.
java.lang.Exception: Discovery component invocation failed.
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:297)
	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:679)
Caused by: java.lang.NullPointerException
	at org.rhq.plugins.jbosscache3.JBossCacheDetailDiscoveryComponent.discoverResources(JBossCacheDetailDiscoveryComponent.java:83)
	at sun.reflect.GeneratedMethodAccessor26.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.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:293)


Expected results:
no exceptions

Additional info:
agent log attached

--- Additional comment from hrupp@redhat.com on 2012-08-14 12:05:19 EDT ---

Can you describe how to get the cache set up, to run into the above issue?
I can see the place of the problem in the code, but would need a running instance of course to replicated.

Is this on Oracle btw?

--- Additional comment from hrupp@redhat.com on 2012-08-14 12:09:53 EDT ---

Line 83 should probably be changed to 

        beanName += ((jmxName==null || jmxName.equals("")) ? "" : "," + jmxName);

as jmxName can probably be null - especially on Oracle, which treats empty strings as null. And the default config entry is:


            <plugin-configuration>
                <c:simple-property name="jmx-resource" default=""/>
            </plugin-configuration>

--- Additional comment from hrupp@redhat.com on 2012-08-14 14:06:49 EDT ---

This property is indeed null.
Comment 1 Heiko W. Rupp 2012-08-14 15:46:03 EDT
master b86e772ba8569

In addition to just fixing the NPE, it was needed to also put the jmx-name into the plugin configuration of the resource. Otherwise the inventory tab's connection properties would have complained that no jmxName is set.
As the resource of type Cache has no jmxName (it basically forms the base name), it is marked as optional.
Comment 2 Heiko W. Rupp 2012-08-14 16:13:45 EDT
release branch 3f1f4c4b92a175d
Comment 3 John Sanda 2012-08-22 01:47:31 EDT
Moving to ON_QA. The JON 3.1.1 ER3 build is available at https://brewweb.devel.redhat.com/buildinfo?buildID=230321.
Comment 4 Filip Brychta 2012-08-22 07:48:41 EDT
Verified on JON 3.1.1 ER3
Comment 5 Heiko W. Rupp 2013-09-03 11:14:12 EDT
Bulk closing of old issues in VERIFIED state.