-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Configure interface-based proxies in native images #31659
Comments
I wonder if we should use |
Yeah that's another option if we consider JVM + AOT mainly from the perspective of testing native behavior on the JVM. |
If we do change this setting for M4 we should open another issue to revert it in M5 or whenever cglib is supported. I think it's best long-term to keep JVM and Native aligned as much as possible. |
FWIW I am not sure we should be doing this. Yes, the exception is very strange and hard to diagnose but working around that by changing the default with AOT sounds a bit odd to me. I'd rather add something to the release notes. |
Let's discuss this in the team meeting. Note to myself: The code which does this is in Spring native is the |
We talked about it in our meeting and decided to close the issue without enabling JDK proxies. It's quite confusing to automatically switch all AOT users to JDK proxies as they have downsides. We'd rather wait for spring-projects/spring-framework#28115 to be completed. If it's not completed when we write end-user facing documentation on AOT, we'll add a bit in the documentation that users have to set |
Now that spring-projects/spring-framework#28717 is fixed, every Spring Boot application using Spring AOP requires to configure
spring.aop.proxy-target-class=false
in order to get it working on native since spring-projects/spring-framework#28115 is not going to be fixed in time for Spring Boot 3.0.0-M4.If not set, the following fatal error is thrown at startup (on purpose):
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'runner': Subclass-based proxies are not support yet in native images
.In order to allow a reasonable developer experience, could Spring Boot 3 automatically configure
spring.aop.proxy-target-class=false
whenNativeDetector#inNativeImage
returnstrue
?The text was updated successfully, but these errors were encountered: