Fail early FactoryBean instantiation for LinkageError#26425
Fail early FactoryBean instantiation for LinkageError#26425liudongmiao wants to merge 4 commits intospring-projects:masterfrom liudongmiao:patch-factorybean-linkageerror
Conversation
In 0288878 to resolve gh-22409, a little bug was introduced: if there is LinkageError in FactoryBean instantiation, no first exception. In JVM, if a class cannot be initialized, it acts like this: - at the first time, it will show the real reason and stack - then, only show "NoClassDefFoundError: Could not initialize class xxx"
|
@liudongmiao Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
|
@liudongmiao Thank you for signing the Contributor License Agreement! |
|
Even the exception is recorded by Sometimes Even if I call addRelatedCause or don't clear suppressedExceptions, the log is confused. |
If there is exception in class initializer, jvm acts like this: - for the first time, show the real reason and stack - then, mark the class in error state, throws only NoClassDefFoundError This commit don't suppress any LinkageError during bean creation.
If there is exception in class initializer, jvm acts like this: - for the first time, show the real reason and stack - then, mark the class in error state, throws only NoClassDefFoundError This commit don't suppress any LinkageError when set property
|
I went with a custom Thanks for the pull request in any case! |
In 0288878 to resolve gh-22409, a little bug was introduced:
if there is LinkageError in FactoryBean instantiation, no first exception.
In JVM, if a class cannot be initialized, it acts like this: