-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail early FactoryBean instantiation for LinkageError #26425
Fail early FactoryBean instantiation for LinkageError #26425
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 Lines 229 to 258 in 4e54c25
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: