TimeZones causing intermittent NPE

343 views
Skip to first unread message

Chad Vincent

unread,
May 20, 2015, 2:52:19 PM5/20/15
to google-a...@googlegroups.com
I seem to be getting this today in bursts:

java.lang.NullPointerException at sun.util.calendar.ZoneInfoFile.readZoneInfoFile(ZoneInfoFile.java:1042) at sun.util.calendar.ZoneInfoFile.createZoneInfo(ZoneInfoFile.java:596) at sun.util.calendar.ZoneInfoFile.getZoneInfo(ZoneInfoFile.java:566) at sun.util.calendar.ZoneInfo.getTimeZone(ZoneInfo.java:663) at java.util.TimeZone.getTimeZone(TimeZone.java:566) at java.util.TimeZone.getTimeZone(TimeZone.java:562)
[.My Code.]

My code:

humanReadableFormat.setTimeZone(TimeZone.getTimeZone(entity.getTimeZone()));

Something wrong with the ZoneInfo file on AppEngine? Any bogus input on my part should return TimeZone.GMT...

Nick

unread,
May 22, 2015, 4:29:25 PM5/22/15
to google-a...@googlegroups.com, ccrvi...@gmail.com
Hey, is there any chance that this has cleared up for you, or is it still happening without any indication as to the cause? 

Nick

unread,
May 22, 2015, 4:38:02 PM5/22/15
to google-a...@googlegroups.com, ccrvi...@gmail.com
Hey, actually, upon further poking, this happens when the input is null. I think your entity might not have its timezone property filled :)

On Wednesday, May 20, 2015 at 2:52:19 PM UTC-4, Chad Vincent wrote:

Chad Vincent

unread,
May 26, 2015, 10:40:13 AM5/26/15
to google-a...@googlegroups.com, ccrvi...@gmail.com
You're right...  Somehow the TimeZone field wasn't getting initialized properly.

This is still counter to the Java spec, though:

the specified TimeZone, or the GMT zone if the given ID cannot be understood.

So getTimeZone(null) should return GMT.
Reply all
Reply to author
Forward
0 new messages