[ https://issues.apache.org/jira/browse/GEODE-2013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hitesh Khamesra closed GEODE-2013. ---------------------------------- > StatArchiveReader throws NullPointerException due to missing ResourceType > ------------------------------------------------------------------------- > > 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 > Fix For: 1.1.0 > > > 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 throw 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.15#6346)