JDK 1.4 'bug'

February 11th, 2005 by Hen

Been having fun with a painful bug in JDK 1.4 on and off over the last week. Seems to be something that is known about out there, so just thought I’d mention it.

An Applet running in JDK 1.4 may not deserialize a java.util.TimeZone object; it breaks the permissions by accessing sun.util.Calendar. I’ve been serializing JFreeChart Time graphs on the server for use on the client and they’d only work in 1.5 or on one particular developer’s 1.4.

In the end I setup a test servlet/applet system, and sent lots of different types of objects back and forth, and used the -verbose flag on the java console (okay, should have done this immediately) until I narrowed the StreamCorruptedException down to TimeZone. The one working developer 1.4 is because he has changed his security permissions to test webstart stuff.

So, solutions seem to be:

  • Upgrade clients to 1.5/5.0.
  • Sign applet.
  • Manually edit the JRE security.
  • Modify JFreeChart to be TimeZone’less in the graphs.

Probably just try to go with 1), though as we run other tools on the client-side it makes the upgrade a bigger deal.

Comments are closed.