Symbian
Symbian OS Library

FAQ-0706 My application crashes with a java.lang.ExceptionInInitializerError on the v6.0 Runtime

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: Java.lang
Created: 05/03/2001 Modified: 06/25/2001
Number: FAQ-0706
Platform: Symbian OS v6.0, Symbian OS v6.1, Symbian OS v7.0

Question:
My application clones the properties hashtable and runs successfully on EPOC RElease 5 and other implementations. But
with the Version 6.0 Symbian Runtime for Java it crashes with a java.lang.ExceptionInInitializerError. What is going
wrong?


Answer:
The problem is that to allow the Version 6.0 Symbian Runtime for Java to pick up the host system Locale setttings, which did not happen under EPOC Release 5, a TimeZone is imported as a system property. This unfortunately breaks an implicit requirement in the Java Runtime that all system properties are strings so that they can be recovered by the getter method public String getProperty(String key) of the java.util.Properties class. The best work around is not to clone the properties hashtable, but only to obtain those properties you know about and need.

From v6.1we will modify the behaviour of the getProperty(String) method so that it converts any object in the properties hashtable transparently to a String before returning it. This would avoid the above complications.