Jump to content
Excelsior Forums
paul

ExceptionInInitializerError ??

Recommended Posts

Hi,

I wonder if anyone else has experienced a similar problem:

We are trying to compile our application (which used to compile fine under 3.5mp3). Since then we adapted the application to JDK1.5 and it runs just fine under JDK1.5.0beta-2.

However, when compiled to an executable, immediately upon startup, or more precisely, when the first class other than the one where the main() method is, is called, it throws:

Exception in thread main: java.lang.ExceptionInInitializerError

Caused by: java.lang.NullPointerException

I tried to debug what it could be. After checking our code and making sure that none of the variables are null, one theory we had is that given the nature of the error, it might be something about calling a static method. We modified the class, by adding an empty constructor method.

Now, from main, I first print a string ("test") to know that the system started fine, and then do

OtherClass myvar = new OtherClass() which causes the exception described above.

I tried all different optimization settings in 3.6mp1, and all with the same result.

Any ideas what might be going on that prevents the executable from running?

Thanks a lot...

Paul

Share this post


Link to post
Share on other sites

×