Posts tagged ·

java

·...

Timezone data update in Java

no comments

Sometimes timezone data changes. The Java’s timezone data is not read from the operating system, it maintains a private repository of timezone data in locally installed files (.../jre/lib/zi).

There is a tool from Sun for updating timezone data in installed JRE or JDK software, which called the Timezone Updater tool, or TZUpdater, it can be downloaded for free. The TZUpdater tool modifies the JDK/JRE software instance that is used to execute the tool. A single image of the JDK/JRE software is modified per execution. The same procedure for Unix or Windows.

First execution with -t option to perform verification tests:

c:\>C:\tibco\tibcojre\1.6.0\bin\java.exe -jar tzupdater.jar -t
/data/tzdata2011k.test:165: time zone not found: America/Sitka
/data/tzdata2011k.test:315: time zone not found: America/Metlakatla
/data/tzdata2011k.test:1151: time zone not found: America/North_Dakota/Beulah
/data/tzdata2011k.test:1277: test failed: America/Resolute
/data/tzdata2011k.test:1370: test failed: Chile/EasterIsland
/data/tzdata2011k.test:1413: test failed: Pacific/Easter
/data/tzdata2011k.test:1564: test failed: America/Havana
/data/tzdata2011k.test:1988: test failed: Cuba
/data/tzdata2011k.test:2236: test failed: America/Goose_Bay
/data/tzdata2011k.test:2278: time zone not found: America/Kralendijk
/data/tzdata2011k.test:2280: time zone not found: America/Lower_Princes
/data/tzdata2011k.test:2315: test failed: America/Santiago
/data/tzdata2011k.test:2447: test failed: Chile/Continental
/data/tzdata2011k.test:2493: test failed: America/St_Johns
/data/tzdata2011k.test:2512: test failed: CNT
/data/tzdata2011k.test:2533: test failed: Canada/Newfoundland
/data/tzdata2011k.test:2762: test failed: Africa/Casablanca
/data/tzdata2011k.test:4024: test failed: Asia/Gaza
/data/tzdata2011k.test:4025: time zone not found: Asia/Hebron
/data/tzdata2011k.test:4035: test failed: Asia/Istanbul
/data/tzdata2011k.test:4227: test failed: Europe/Istanbul
/data/tzdata2011k.test:4417: test failed: Turkey
/data/tzdata2011k.test:4442: time zone not found: Africa/Juba
/data/tzdata2011k.test:4457: test failed: Europe/Kaliningrad
/data/tzdata2011k.test:4460: test failed: Europe/Kiev
/data/tzdata2011k.test:4463: test failed: Europe/Minsk
/data/tzdata2011k.test:4466: test failed: Europe/Simferopol
/data/tzdata2011k.test:4469: test failed: Europe/Uzhgorod
/data/tzdata2011k.test:4472: test failed: Europe/Zaporozhye
/data/tzdata2011k.test:4566: test failed: Europe/Moscow
/data/tzdata2011k.test:4569: test failed: Europe/Samara
/data/tzdata2011k.test:4572: test failed: Europe/Volgograd
/data/tzdata2011k.test:4599: test failed: W-SU
/data/tzdata2011k.test:4631: test failed: Asia/Yekaterinburg
/data/tzdata2011k.test:4644: test failed: Asia/Novokuznetsk
/data/tzdata2011k.test:4647: test failed: Asia/Novosibirsk
/data/tzdata2011k.test:4650: test failed: Asia/Omsk
/data/tzdata2011k.test:4668: test failed: Asia/Krasnoyarsk
/data/tzdata2011k.test:4693: test failed: Asia/Irkutsk
/data/tzdata2011k.test:4814: test failed: Asia/Yakutsk
/data/tzdata2011k.test:5059: test failed: Asia/Sakhalin
/data/tzdata2011k.test:5062: test failed: Asia/Vladivostok
/data/tzdata2011k.test:5116: test failed: Asia/Anadyr
/data/tzdata2011k.test:5119: test failed: Asia/Kamchatka
/data/tzdata2011k.test:5122: test failed: Asia/Magadan
/data/tzdata2011k.test:5190: test failed: Pacific/Fiji
/data/tzdata2011k.test:5247: test failed: Pacific/Apia
/data/tzdata2011k.test:5262: test failed: MIT

So we can see a list of incorrect timezone data in JRE that we have with the latest TIBCO TRA. It’s time to perform an update:

c:\>C:\tibco\tibcojre\1.6.0\bin\java.exe -jar tzupdater.jar -u

Don’t forget to restart all TIBCO processes (Java instances) to pick up new timezone data.

Could not create the Java virtual machine

1 comment

You may encounter this problem when installing TIBCO products on Solaris x86. In my case it was Runtime Agent 5.6.0 installation.

./TRA.5.6.0-suite_sol10_x86.bin -console

Then installation fails and the error message looks like this:

Unrecognized option: -cp:TRA.5.6.0-suite_sol10_x86.jar:TRA.5.6.0-simple_sol10_x86.jar:tibrv.8.1.1-simple_sol10_x86.jar:jre.1.5.0-simple_sol10_x86_64.jar:Designer.5.6.0-simple_sol10_x86_64.jar:tpcl.5.6.0-simple_sol10_x86.jar:hawk.4.8.1-simple_sol10_x86_64.jar:/var/tmp/isjCAAWCa4en/TRA.5.6.0-suite_sol10_x86.jar:
Could not create the Java virtual machine.

There is a bug in the installer, as a workaround you can force the installer to use Java in the system. Just specify -is:javahome option like in my example:

./TRA.5.6.0-suite_sol10_x86.bin -console -is:javahome /usr/jdk/jdk1.5.0_24/

Should work now.

TIBCO Hawk NoClassDefFoundError issue

1 comment

On the Windows platform you can experience java.lang.NoClassDefFound Error when starting Hawk Agent or Hawk Display. In my example I use TIBCO EMS as a transport for Hawk messaging and issue arose after upgrade EMS from version 4 to version 5 on the server. The reason is that in EMS version 5.1 paths to java class libraries are: <Tibco_Root>\ems\5.1\lib\jms.jar; <Tibco_Root>\ems\5.1\lib\tibjms.jar; <Tibco_Root>\ems\5.1\lib\tibrvjms.jar; <Tibco_Root>\ems\5.1\lib\tibcrypt.jar;
In EMS 4.x. paths were: <Tibco_Root>\ems\clients\java\jms.jar; <Tibco_Root>\ems\clients\java\tibjms.jar; <Tibco_Root>\ems\clients\java\tibrvjms.jar; <Tibco_Root>\ems\clients\java\tibcrypt.jar; <Tibco_Root>\ems\clients\java\jaxp.jar; and they remained in the Hawk configuration.

On windows this configuration is stored in the registry. Just open regedit and modify three classpath strings under HKLM\SOFTWARE\Tibco Software\TIB/Hawk\<version>.

For TIBCO Rendezvous transport situation can be the same, if path to used jar <Tibco_Root>\tibrv\lib\tibrvj.jar; was changed.

About classpath and Hawk. In general, NoClassDefFoundError is a Java (JVM) error that occurs when a class needed to run a Java program cannot be found. Here are Hawk is Java program and classes (a set of dynamically loadable libraries that Java applications can call at runtime) in the jar files mentioned above. Classpath is an argument that tells the JVM where to look for user-defined classes and packages in Java programs.

On Unix in the startagent startup script for TIBCO Hawk Agent for example, you can find something like this:
# If EMS_ROOT is set, add EMS jars files.
if [ ! -z "$EMS_ROOT" ]; then
JARFILE="$JARFILE:$EMS_ROOT/clients/java/jms.jar"
JARFILE="$JARFILE:$EMS_ROOT/clients/java/tibjms.jar"
JARFILE="$JARFILE:$EMS_ROOT/clients/java/tibrvjms.jar"
JARFILE="$JARFILE:$EMS_ROOT/clients/java/tibcrypt.jar"
fi
# Add jar files for RV.
JARFILE="$JARFILE:$RV_ROOT/lib/tibrvj.jar"
# Add existing CLASSPATH environment variable to class path.
JARFILE="$JARFILE:$CLASSPATH"

Here are the same classes and classpath variable. So, please keep in mind this.