You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Kirk Lund (JIRA)" <ji...@apache.org> on 2016/11/02 21:05:58 UTC

[jira] [Issue Comment Deleted] (GEODE-2013) StatArchiveReader may throw NullPointerException while loading StatArchiveFile

     [ https://issues.apache.org/jira/browse/GEODE-2013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kirk Lund updated GEODE-2013:
-----------------------------
    Comment: was deleted

(was: A NullPointerException is thrown by StatArchiveReader when a statistics archive file contains one or more Resource instances for a ResourceTypeId that does not have a corresponding ResourceType written to the file.

The underlying cause was exposed by the test for GEODE-2012 which has been fixed. )

> StatArchiveReader may throw NullPointerException while loading StatArchiveFile
> ------------------------------------------------------------------------------
>
>                 Key: GEODE-2013
>                 URL: https://issues.apache.org/jira/browse/GEODE-2013
>             Project: Geode
>          Issue Type: Bug
>          Components: statistics
>    Affects Versions: 1.0.0-incubating
>            Reporter: Kirk Lund
>            Assignee: Kirk Lund
>
> StatArchiveReader will throw a NullPointerException while loading a Resource from a stat archive file that is missing the corresponding ResourceType. GEODE-2012 can result in a stat archive file that is missing a ResourceType.
> Example of stack trace:
> {noformat}
> ERROR: Operation "stats" failed because: java.lang.NullPointerException.
> java.lang.NullPointerException
> 	at org.apache.geode.internal.statistics.StatArchiveReader$StatArchiveFile.loadInstance(StatArchiveReader.java:3049)
> 	at org.apache.geode.internal.statistics.StatArchiveReader$StatArchiveFile.readResourceInstanceCreateToken(StatArchiveReader.java:3159)
> 	at org.apache.geode.internal.statistics.StatArchiveReader$StatArchiveFile.readToken(StatArchiveReader.java:3308)
> 	at org.apache.geode.internal.statistics.StatArchiveReader$StatArchiveFile.update(StatArchiveReader.java:2884)
> 	at org.apache.geode.internal.statistics.StatArchiveReader.update(StatArchiveReader.java:145)
> 	at org.apache.geode.internal.statistics.StatArchiveReader.<init>(StatArchiveReader.java:77)
> 	at org.apache.geode.internal.SystemAdmin.statistics(SystemAdmin.java:1136)
> 	at org.apache.geode.internal.SystemAdmin.invoke(SystemAdmin.java:2063)
> 	at org.apache.geode.internal.SystemAdmin.main(SystemAdmin.java:1977)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
> {noformat}
> The NullPointerException is not helpful. The StatArchiveReader should be changed to provide an IllegalStateException with a message that provides helpful information about what's wrong/missing. Message should be "ResourceType is missing for resourceTypeId n" where "n" is the id for the missing ResourceType.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)