Bug 972574 - NPE in DataMigrator with empty (1h) table
Summary: NPE in DataMigrator with empty (1h) table
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Monitoring
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-10 07:04 UTC by Heiko W. Rupp
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Heiko W. Rupp 2013-06-10 07:04:37 UTC
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.