Bug 712311 - NPE in server, when a current res config can not be obtained
Summary: NPE in server, when a current res config can not be obtained
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 4.1
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: Heiko W. Rupp
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon3-sprint1 715334
TreeView+ depends on / blocked
 
Reported: 2011-06-10 09:26 UTC by Heiko W. Rupp
Modified: 2012-02-07 19:19 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-02-07 19:19:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Heiko W. Rupp 2011-06-10 09:26:31 UTC
Start a server with no agents running, go into inventory for a resource with config.
See the red bar showing up and the server log showning

Caused by: java.lang.NullPointerException
        at org.rhq.enterprise.server.configuration.ConfigurationManagerBean.getLatestResourceConfigurationUpdate(ConfigurationManagerBean.java:419)
        at org.rhq.enterprise.server.configuration.ConfigurationManagerBean.getLatestResourceConfigurationUpdate(ConfigurationManagerBean.java:431)

This comes from the fact that we 


        } catch (NoResultException nre) {
            // The Resource hasn't been successfully configured yet - return null.
            current = null;
        }

earlier in the method, but all the if() that may return from the method, are skipped.

Comment 1 Heiko W. Rupp 2011-06-14 08:15:01 UTC
master: 9c04e5b

Comment 2 Sunil Kondkar 2011-06-16 08:58:51 UTC
Verified on build#140 (Version: 4.1.0-SNAPSHOT Build Number: 5905b70)

Navigated to the configuration tab of a RHQ Agent when the agent was not running.
The sever log does not display any exception. It displays the configuration details and the server log displays below:

2011-06-16 14:15:59,977 WARN  [org.rhq.enterprise.server.configuration.ConfigurationManagerBean] Agent is unreachable [Agent[id=10001,name=suniltest,address=10.65.201.124,port=16163,remote-endpoint=socket://10.65.201.124:16163/?rhq.communications.connector.rhqtype=agent&numAcceptThreads=1&maxPoolSize=303&clientMaxPoolSize=304&socketTimeout=60000&enableTcpNoDelay=true&backlog=200,last-availability-report=1308213761716]] - cannot get live configuration for resource [Resource[id=10002, type=RHQ Agent, key=RHQ Agent, name=RHQ Agent, parent=suniltest, version=4.1.0-SNAPSHOT]]
2011-06-16 14:15:59,978 WARN  [org.rhq.enterprise.server.configuration.ConfigurationManagerBean] Could not get live resource configuration for resource [Resource[id=10002, type=RHQ Agent, key=RHQ Agent, name=RHQ Agent, parent=suniltest, version=4.1.0-SNAPSHOT]]; will assume latest resource configuration update is the current resource configuration.


Marking as verified.

Comment 3 Mike Foley 2012-02-07 19:19:22 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE


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