Bug 972574 - NPE in DataMigrator with empty (1h) table
NPE in DataMigrator with empty (1h) table
Status: NEW
Product: RHQ Project
Classification: Other
Component: Monitoring (Show other bugs)
4.8
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-10 03:04 EDT by Heiko W. Rupp
Modified: 2013-06-10 03:04 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2013-06-10 03:04:37 EDT
Description of problem:

$ java -jar target/migrator-executable/data-migrator-4.8.0-SNAPSHOT.jar   --cassandra-port=9142
Estimation process - starting

java.lang.NullPointerException
	at org.rhq.server.metrics.migrator.workers.MetricsIndexUpdateAccumulator.getLastAggregationTime(MetricsIndexUpdateAccumulator.java:158)
	at org.rhq.server.metrics.migrator.workers.MetricsIndexUpdateAccumulator.<init>(MetricsIndexUpdateAccumulator.java:77)


This happens when e.g. the 1h (and probably the 6h) table has no data in it.

Problem is in


org.rhq.server.metrics.migrator.workers.MetricsIndexUpdateAccumulator#getLastAggregationTime
[...]
        if (duration != null && queryString != null) {
            Query query = session.createSQLQuery(queryString);
            String queryResult = query.uniqueResult().toString();

Here query.uniqueResult() can be null if no data is present

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