Archive for October, 2005

TimeZone on Red Hat Linux

October 20, 2005

On my development box I was facing a weird problem of java (1.4.2_04) Timezone not being what it should be. The good part is that this is not happening on the client box. So all this was ok as the only place it was getting used was in the log4j logs I was just offsetting the time to my time in my head ;) (Too lazy I know). But recently we were adding some code that was dependent on the timezone in that the time was the content of a mail sent to users and not everybody was prepared for my “mental offset” solution.

Googling for an answer I found this link http://minaret.biz/tips/timezone.html which describes the exact problem I had and a solution that works for me (export TZ=). I basically stuck this export TZ="whatever" to my bash profile.

Upgrading the java version to 1.5.0_02 doesn’t make a difference either and the Linux time zone is also set perfectly and the date command works as it should.

One thing I would like to add is that use the complete name “America/Los_Angeles” and not an ID like PST or JST. Setting the ID works for Java but the date command doesn’t get it, so if you have native apps then they would start acting up because of this.

Oh yeah, if I ever find out what the problem is to begin with, it will be posted here too :) for now this fix will have to make do.

Update: Check your /etc/localtime ;)

Swing based Pet Store

October 5, 2005

Is there a Swing based Rich client implementation of the Petstore application or something similar? I wanted to see the J2EE design patterns and blueprints put to practice in a Swing based rich client. The blue prints at http://java.sun.com/reference/blueprints/ and http://corej2eepatterns.com/ primarily focus on Web based applications but other than Presentation Tier everything should remain the same for a Swing based one. Macromedia has done something similar http://www.macromedia.com/devnet/blueprint/, pretty neat. Guess I could get cracking on this one.