Can I assume that every NoClassDefFoundError
thrown from JDK class loading mechanism will always have ClassNotFoundException
as a cause in stacktrace?
Also, where actually NoClassDefFoundError
is thrown and its cause is initialized to be ClassNotFoundException
? I cannot find Java code responsible for that logic.
This is how usually stacktraces look to me:
Exception in thread "main" java.lang.NoClassDefFoundError: package/Missing
at package.Missing(Missing.java:110)
Caused by: java.lang.ClassNotFoundException: package.Missing
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more