-
Notifications
You must be signed in to change notification settings - Fork 38.5k
6.2.0 broke with "Could not register object [@someHash] under bean name 'blabla': there is already object [@sameHash] bound" #34427
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
We are going to need that sample unfortunately. I'm not sure we have enough information to understand where the problem is. |
Also, please try to reproduce this against 6.2.3 rather than 6.2.0. Several regressions have been fixed in the meantime which makes it easier to isolate where a remaining problem could be. |
Sorry, I should have mentioned I also tested against the latest 6.2.3 and 7.0.0-M2 but they also have the same problem. |
@fmarot for a start, it would help to see the stacktrace for that exception. That's essentially an assertion, for some reason |
Here is the stacktrace. I'll try to write a SSCCE (https://sscce.org/) but no guarantee.
|
Interesting, that's for a top-level bean even - no nesting, no circle. Somehow we seem to end up in a pre-registered state in that regular code path, that's clearly a bug. That helps a lot for investigating this, thanks! I'll try to sort it out for the 6.2.4 release this Thursday which we'll do just-in-time for the Spring Boot 3.4.3 release. |
Thanks @jhoeller , I got the latest spring-beans-6.2.4-20250218.142954-8.jar and I can confirm that you fixed the problem. Big thank you ! |
Thanks for the immediate testing of the snapshot, much appreciated! |
Closes spring-projectsgh-34427 Signed-off-by: Vincent Potucek <vincent.potucek@sap.com>
Hello, until 6.1.7 my program had been working fine for many years, but 6.2.0 introduced a change that made it break with:
"Could not register object [presetClientService@5404b7d9] under bean name 'blabla': there is already object [presetClientService@5404b7d9] bound"
The hash Id is the same so I'm under the impression that some bean is found in the bean registry and spring tries to re-add it in the registry. Why ?!
I was not able to create a simple reproducer yet.
To give you more details the code looks like this with 3 @configuration classes referenced:
And the failing @configuration class contains:
The problem comes from the call to presetClientService(). If I replace this call with null, the loading of the context is OK.
Was working fine since years and broke with 6.2.0.
I could re-try to create a real-failing sample if really needed, but for now I failed at it.
Regards
The text was updated successfully, but these errors were encountered: