Debug NoClassDefFoundError

Christian Beikov christian.beikov at gmail.com
Mon May 17 16:19:19 UTC 2021


Hi,

not sure if this is the right place to ask, so if I am wrong, please let 
me know where to ask this.

I have a very strange problem with a generated class defined dynamically 
into a module through `MethodHandles.Lookup.defineClass`. When I try to 
instantiate it, I get a `java.lang.NoClassDefFoundError: Could not 
initialize class ...` without any further context:


     at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
     at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
     at 
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
     at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

Does anyone know how to further debug this? I was trying to find 
instructions for debugging the JVM itself but couldn't so far.

Regards,

Christian




More information about the hotspot-dev mailing list