Bug 788334 - NullPointerException thrown from AvailabilityManagerBean
Summary: NullPointerException thrown from AvailabilityManagerBean
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 4.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.3.0
Assignee: Heiko W. Rupp
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-08 04:21 UTC by Elias Ross
Modified: 2013-09-01 10:19 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-01 10:19:02 UTC
Embargoed:


Attachments (Terms of Use)

Description Elias Ross 2012-02-08 04:21:05 UTC
Description of problem:

I've been doing development of plugins and noticed the following in the logs.

2012-02-05 20:47:36,072 INFO  [org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl] Error processing availability report from [vg61l01ad-hadoop002]: javax.ejb.EJBException:java.lang.NullPointerException -> java.lang.NullPointerException:null

I traced the problem down to something being null in AvailabilityManagerBean.mergeAvailabilityReport().

It's not clear if the issue is coming from a bad plugin. My plugin would fail to return from its start() method and I suppose this might have prevented some database process from occurring.

The resources do appear in the tree, however, they are all unavailable.


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

RHQ 4.1, but the code seems to not have changed recently.


How reproducible:

Removing the resource (server) and discovering it again doesn't seem to cause it to clear.


Steps to Reproduce:
1. Create a bad(?) plugin; deploy
2. Discovery fails (or never completes) as the start() method fails.
3. Notice the logs
  
Expected results:

The server should guard against bad data and provide some indication what was bad about the data.


Additional info:

I will provide more information as I find it.

Comment 1 Heiko W. Rupp 2012-02-08 11:05:12 UTC
I have seen something similar with the very first availability report of a new resource.

The problem is in org.rhq.enterprise.server.measurement.AvailabilityManagerBean#updateResourceAvailability where the variable 'currentAvailability' is null for when no ResourceAvailability has been set, as this was the first report to come in.

Comment 2 Heiko W. Rupp 2012-02-08 11:10:08 UTC
master 34ed3853dda

Comment 3 Elias Ross 2012-02-08 17:28:46 UTC
I'll test and verify. However, wouldn't this case happen very frequently?

Looking at the commit, I'd also feel better about this if there was a unit test case added as well. Is there such a test for your EJB components?

Comment 4 Heiko W. Rupp 2013-09-01 10:19:02 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.


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