Tuesday, November 23, 2010

java.lang.NoClassDefFoundError: Initialization failure : java.lang.J9VMInternals.initialize

Are you getting this exception?

java.lang.NoClassDefFoundError: abc.MyClass (initialization failure)
 at java.lang.J9VMInternals.initialize(J9VMInternals.java) 
This error happens when there is an exception while the class is instantiated.
Check the below points

1) Check the constructor and make sure there is nothing which could throw a Runtime exception

2) Check the body of the class and see if there is a possibility of NullPointer or any other Runtime exception while assigning value to the fields
Mostly this could happen when you are assgning values to static fields which might not resolve properly while class loading.

Blog Archive