Daemonite: Aussie timezone bug in JVM 1.4.1 Archive

Daemonite: Aussie timezone bug in JVM 1.4.1 Archive


Wednesday, June 11, 2003
Aussie timezone bug in JVM 1.4.1

Running CFMX with JRE version 1.4.1 seems to produce the wrong date/time for Aussies even though the windows time and locale may be set correctly (using getLocal() produces expected result). For example, now() function produces a GMT time even though in our case, Windows was set to "(GMT +10:00) Canberra, Melbourne, Sydney".

Given that upgrading to a later JVM will bring performance benefits, and future versions CFMX or J2EE for CFMX may well bring you into contact with more recent JVM versions, we thought this Antipodean anomaly was worth pointing out -- and of course we've got a solution :)

This appears to be a known issue with the Sun 1.4.1 JRE. (bug detailed here but you'll need a login). The only known fix is to put in your own JVM arguments.

Reading through Debbie Dickerson's notes on cfguru blog about the so called now() bug in CFMX, it seems you can define the user.timezone property in Java to override the windows timezone settings. Entering the following into the JVM arguments field in CF Administrator fixes the problem:

-Duser.timezone=Australia/Sydney

You'll need to restart the CFMX server before changes will take effect.

Just a word of caution: if you can't restart and get something like "Service-specific Error 2" -- it's likely you've made a mistake keying in your arguments. Luckily, everytime you change JVM settings the {CFMX}/runtime/bin/jvm.config gets backed up automatically -- just recover this file and try again.

[thanks to Brendan Sisson (fellow Daemonite) for digging up this solution]

Update
Note this has nothing to do with the infamous Fix for Aussie Scheduling Bug -- this was fixed in CFMX updater2.

Posted by modius at 09:28 PM | Permalink
Trackback: http://blog.daemon.com.au/cgi-bin/dmblog/mt-tb.cgi/123

Comments

I just wish there was a function for asking the operating system what it thinks the local time is. Most of the time I don't care about the GMT time anyway.

Posted by: Glen Stampoultzis on August 18, 2003 09:40 AM

Do you know where it gets backed up to?

Posted by: Steve Onnis on October 1, 2003 11:35 PM