-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
CGLIB runtime enhancement not supported on native image #30939
Comments
same as #30937 (comment) |
When trying to reproduce the issue, it only happened with The reproducer is now updated. |
Thanks. The runtime expects @jhoeller any idea how we could debug this? |
Output of the |
Is there any chance in getting this finding out how this can be debugged/finding out why the second proxy would be necessary/why it isn't generated? |
@danthe1st, what happens if you remove |
Originally, I didn't have the hibernate enhancer plugin in my reproducer and I just added it after #30939 (comment) but I will update it. |
I have removed the plugin in a branch named |
@danthe1st to answer your question, we'll have to debug it to understand why the second proxy was not generated at build-time. It's high on my list and I hope to get to that next week. |
I believe this may actually be a duplicate of #31238 (see #31238 (comment)). In any case, I think the underlying problem is that a new proxy class is generated for (what should be) the same key, which might imply that there is something wrong with the key we generate. |
I want to note that in contrast to #31238, this issue only seems to occur with Spring Boot 3.1.x and not with 3.0.x (if I remember correctly) |
I have confirmed that the local fix I have in place for #31238 allows the native image tests for the example project for this issue to pass using Spring Boot 3.1.2 and Spring Framework 6.0.13-SNAPSHOT. In light of that, I am closing this issue as a: |
It turns out this issue was not only a duplicate of #31238 but also a: Although I knew part of this issue was resolved in 6.0.13-SNAPSHOT, I wasn't sure what had actually caused the second attempt to create the So I decided to debug the sample application for this issue further, and in doing so I noticed that #31050 was causing the first attempt to load the test's With that, the mystery is solved! |
Affects: Spring 6.0.11 / Spring Boot 3.1.2
For reproducing the issue, I highly recommend starting with the attached reproducer linked below.
Assume an application with the following components:
Let this application have a controller with an endpoint accepting a
MultipartFile
RequestParam
that calls an@Transactional
method.Add an entity with a
String
field (@Id
) and aCrudRepository
with agetBy<The string field>
.Add an
ApplicationListener<ApplicationReadyEvent>
which calls the above method.Add a
@SpringBootTest
with two@Test
methods, one of them annotated with@WithMockUser
. These test methods can be empty.Run the tests using
native-image
withmvn -PnativeTest test
. An exception like the following should occur:Reproducer: https://github.com/danthe1st/spring-cglib-repro/actions/runs/5648996009
Build log with error: https://github.com/danthe1st/spring-cglib-repro/actions/runs/5648996009/job/15302392597
This issue is similar to #30937 but the error is different so I decided to report both issues.
The text was updated successfully, but these errors were encountered: