I have a GUI application. In my main class I have a method (called createAndShow()
) to initialize all my GUI classes. Inside each GUI class, I have static initializer
to read properties files(resource bundles or configuration files). If a file or entry is missing or value is wrong, I catch the exception and then throws a MissingResourceException
to upper level on purpose. In my createAndShow()
method of the main class, I put a try-catch to catch Exception
. But somehow JVM refuse to get there. Whenever a file is missing, that MissingResourceException
is thrown and then the application just hang. I expected the createAndShow()
method will catch that exception and exit gracefully. Is there anything special for exceptions throws from the static initializer?
I am using XP and java 1.6.