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.

4 comments:

  1. Thanks a lot! That helped me with the issue that I was struggling for 3 days. I was thinking the classloader is not finding the class but it is finding but there were Runtime issue within the class.

    Thanks again.

    ReplyDelete
  2. But what u did to solve this issue as I m getting the same error after giving login/password to login page

    ReplyDelete
  3. Hi Ishita, I didnt understand your question. Can you please elaborate?

    ReplyDelete
  4. Thanks.. it works !!!
    The problem was there was a NullPointer in the static block.

    Regards
    Yogesh
    yogesh249@gmail.com

    ReplyDelete

Blog Archive