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
DisposableBeanAdapter.destroy() method should not log error on destroy failures [SPR-4478] #9155
Comments
Juergen Hoeller commented Why is it that your destroy methods actually fail in such "senseless" form? What kind of stacktraces do you see there that happen all the time but can be safely ignored? Juergen |
Juergen Hoeller commented I've revised bean destruction logging to log at WARN level with the exception toString only. The full exception will still be logged when DEBUG level is active. This will make it into Spring 2.5.2. However, components should not usually thrown an exception from their destroy method. If you repeatedly encounter such exceptions, double-check whether your destroy methods are implemented properly... They should maybe catch non-serious exceptions themselves and swallow them internally, not propagating them to the container. Juergen |
Niklas Schlimm commented I am using a standard job configuration with spring batch 1.0.0.m4. 265 [main] ERROR org.springframework.beans.factory.support.DisposableBeanAdapter - Couldn't invoke destroy method of bean with name 'scopedTarget.hibernateItemReader' Job configuration:
|
Juergen Hoeller commented Thanks for the details! I've forwarded this to the Spring Batch guys - for them to check whether they can handle those non-critical cleanup exceptions explicitly. Juergen |
Niklas Schlimm opened SPR-4478 and commented
Only a small but irritating one (generates lots of noncritical exceptions in our log file):
org.springframework.beans.factory.support.DisposableBeanAdapter.destroy() generates lots of senceless exception traces in my log.
Method shows the following code sequence:
try {
((DisposableBean) this.bean).destroy();
}
catch (Throwable ex) {
logger.error("Couldn't invoke destroy method of bean with name '" + this.beanName + "'", ex);
}
All excpetions are logged as errors with complete excpetion trace, but nothing else happens in catch block ...
Loads of noncritical exception traces in log file. Developers spending valuable time on analyzing what happens.
Log a warning instead saying that destroy failed. Do not log exception trace.
Affects: 2.5.1
The text was updated successfully, but these errors were encountered: