8056900: Enhance NoClassDefFound exception messaging

Add text to the message explaining the cause of the exception

Reviewed-by: dholmes, sspitsyn, coleenp
This commit is contained in:
Harold Seigel 2017-05-04 10:05:29 -04:00
parent 006229255a
commit 5b7ff7579c
6 changed files with 180 additions and 7 deletions

View file

@ -522,7 +522,11 @@ bool InstanceKlass::link_class_impl(bool throw_verifyerror, TRAPS) {
// if we are executing Java code. This is not a problem for CDS dumping phase since
// it doesn't execute any Java code.
ResourceMark rm(THREAD);
THROW_MSG_(vmSymbols::java_lang_NoClassDefFoundError(), external_name(), false);
Exceptions::fthrow(THREAD_AND_LOCATION,
vmSymbols::java_lang_NoClassDefFoundError(),
"Class %s, or one of its supertypes, failed class initialization",
external_name());
return false;
}
// return if already verified
if (is_linked()) {