-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Injecting bean in configurable class using load-time weaving broken when referenced on scoped-proxy class [SPR-14892] #19458
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
Comments
Juergen Hoeller commented In 4.3.4, we only really added an If you're seeing Any chance you could compare when your class gets loaded with 4.3.3 vs 4.3.4, and which stacktrace actually triggers that? |
Holger Stenzhorn commented I must admit that I was a little too quick when submitting this bug report initially. So I performed some further testing/debugging and now found the exact constellation when the issue occurs for me and when not. With the code below, when I now call the method But when I perform on
(Note again that this behavior is specific to version 4.3.4 as I always get the correct behavior that the object is printed on the console with version 4.3.3.)
|
Juergen Hoeller commented I'm afraid it is generally very fragile to declare load-time-weaved types in method signatures of other classes. Any attempt to introspect those methods will trigger loading of those classes, and if this happens before the I haven't found a specific change in 4.3.4 that radically impacted the arrangement here. Our general introspection of method signatures, e.g. finding |
Holger Stenzhorn commented Well, albeit this might indeed be brittle, the actual code - i.e. not the above toy test class - had always worked fine since I had introduced it quite some time ago... So I checked my code again and I (seemingly) found the "culprit": I employ Java-based configuration and in the configuration class I use |
Holger Stenzhorn commented As a follow-up to my previous comment: I have dogged a bit in the code changes between 4.3.3 and 4.3.4 and the cause of my issue is rooted in the change performed for #19382 in the class |
Juergen Hoeller commented This turns out to be due to a misguided |
Holger Stenzhorn commented Great! Thanks a lot for fixing this issue! |
Uh oh!
There was an error while loading. Please reload this page.
Holger Stenzhorn opened SPR-14892 and commented
In version 4.3.3 the following code to inject a bean into a Hibernate entity using load time weaving worked flawlessly and
someBean
is correctly set but after upgrading to version 4.3.4someBean
is nownull
.Affects: 4.3.4
Issue Links:
The text was updated successfully, but these errors were encountered: