Skip to content
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

Missing destroy-method warning intentional? #28762

Closed
scantor opened this issue Jul 5, 2022 · 8 comments
Closed

Missing destroy-method warning intentional? #28762

scantor opened this issue Jul 5, 2022 · 8 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue

Comments

@scantor
Copy link

scantor commented Jul 5, 2022

In latest Spring 6 milestones there's a warning logged now any time a default-destroy-method is set and the method is missing from any beans (one logged per bean):

e.g.:

11:13:42.928 - WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory:591] - Destruction of bean with name 'net.shibboleth.idp.saml.attribute.transcoding.AbstractSAML2AttributeTranscoder.NamingFunction#71a3a190' threw an exception
java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Method.getParameterCount()" because "destroyMethod" is null

I don't think Spring 5 or earlier has been logging this, and before we rototilled a lot of bean files I wanted to make sure this change was intentional and going to stay. It's certainly not wrong, just somewhat inconvenient for a lot of existing files.

I did note an old (like 2009) issue filed and fixed that mentions a similar NPE and perhaps had been "fixed", suggesting maybe this is not intentional.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 5, 2022
@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Feb 9, 2023
@scantor
Copy link
Author

scantor commented May 11, 2023

I think this may have been fixed, but I have not actually found the commit that changed the behavior. In any case, I don't see any logging even on TRACE with this message in it.

@snicoll
Copy link
Member

snicoll commented May 11, 2023

In latest Spring 6 milestones

Can you please try with 6.0.9 and let us know if you can reproduce? I think this has been fixed indeed.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label May 11, 2023
@scantor
Copy link
Author

scantor commented May 11, 2023

We're not seeing it with any recent versions, I was just hoping to track down the actual change for "confidence". The line number should correlate to one of the MILESTONE releases so I'm still going to try and find it, but I think this can be closed.

@snicoll
Copy link
Member

snicoll commented May 11, 2023

OK cool. I think this is (now) a duplicate of #30301. Sorry for the lack of follow-up here!

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2023
@snicoll snicoll added status: duplicate A duplicate of another issue and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels May 11, 2023
@scantor
Copy link
Author

scantor commented May 11, 2023

I do see the particular log message in the code base in a different class, and it's still logged on warn, so it's possible it's still there in certain cases but just not the one we originally reported.

@snicoll
Copy link
Member

snicoll commented May 11, 2023

The warning must be logged if something legit failed. The problem here is that it was logged for the wrong reason.

@scantor

This comment was marked as outdated.

@scantor

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants