Bug 848030 - NullPointerException during discovery for [Cache] Resources, EAP5.1.2
Summary: NullPointerException during discovery for [Cache] Resources, EAP5.1.2
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: JON 3.1.1
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: RHQ 4.5.0
Assignee: Heiko W. Rupp
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 848135
TreeView+ depends on / blocked
 
Reported: 2012-08-14 11:21 UTC by Filip Brychta
Modified: 2013-08-31 10:13 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 848135 (view as bug list)
Environment:
Last Closed: 2013-08-31 10:13:18 UTC
Embargoed:


Attachments (Terms of Use)
agent log (47.03 KB, text/x-log)
2012-08-14 11:21 UTC, Filip Brychta
no flags Details

Description Filip Brychta 2012-08-14 11:21:30 UTC
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

Comment 1 Heiko W. Rupp 2012-08-14 16:05:19 UTC
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?

Comment 2 Heiko W. Rupp 2012-08-14 16:09:53 UTC
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>

Comment 3 Heiko W. Rupp 2012-08-14 18:06:49 UTC
This property is indeed null.

Comment 4 Heiko W. Rupp 2012-08-14 19:44:38 UTC
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 5 Filip Brychta 2012-08-15 06:46:24 UTC
(In reply to comment #1)
> Can you describe how to get the cache set up, to run into the above issue?
No set up was done, just clean installation of EAP5.1.2 was running with 'all' profile (./run.sh -c all)
> 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?
No, postgres was used.

Comment 6 Filip Brychta 2013-08-26 08:56:36 UTC
Verified on
Version: 4.9.0-SNAPSHOT
Build Number: d428376

Comment 7 Heiko W. Rupp 2013-08-31 10:13:18 UTC
Bulk close of old bugs in VERIFIED state.


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