-
Notifications
You must be signed in to change notification settings - Fork 613
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
AOT support for multiple binders #2655
Comments
I think this problem also applies when only one binder is used.
Both build commands will fail with the above error. Changing to 3.0.3 in Build status of spring-aot-smoke-tests can be monitored here: https://github.com/spring-projects/spring-aot-smoke-tests/blob/main/STATUS.adoc#cloud |
@onobc referring to you as an AOT expert in streams. . . can you please take a look at that |
Digging... |
Some facts
The fix...
|
... and Spring Integration 6.0.4 same date. |
* Remove the use of instance suppliers on bean definitions that are processed during the AOT phase. * The remaining areas that use instance suppliers do so at runtime and do not use reflection, but instead are passed the configured bean to register. See spring-cloud/spring-cloud-stream#2655
* Remove the use of instance suppliers on bean definitions that are processed during the AOT phase. * The remaining areas that use instance suppliers do so at runtime and do not use reflection, but instead are passed the configured bean to register. See spring-cloud/spring-cloud-stream#2655
* Remove the use of instance suppliers on bean definitions that are processed during the AOT phase. * The remaining areas that use instance suppliers do so at runtime and do not use reflection, but instead are passed the configured bean to register. See spring-cloud/spring-cloud-stream#2655 **Cherry-pick to `6.0.x`**
* Remove the use of instance suppliers on bean definitions that are processed during the AOT phase. * The remaining areas that use instance suppliers do so at runtime and do not use reflection, but instead are passed the configured bean to register. See spring-cloud/spring-cloud-stream#2655 **Cherry-pick to `6.0.x`**
adding myself here |
It seems like the problem is resolved now, using Spring Boot 3.0.5-SNAPSHOT. Both https://github.com/spring-projects/spring-aot-smoke-tests/blob/main/STATUS.adoc#cloud and https://ci.spring.io/teams/spring-aot-smoke-tests/pipelines/spring-aot-smoke-tests-1.0.x/jobs/integration-app-test are green now! |
Using versions as below: Main Class: |
@onobc any update on the above? |
@kartik-kaushik I have not had a chance to look at this since your report. I will try to get to it today though. |
@kartik-kaushik do. you mind bumping up to the following and trying again:
A few questions as well:
Thanks |
@onobc it didn't worked with the above as well. Are you using buildpacks or GraalVM build tools to build the native image? If build tools, what version of GraalVM are you using? Are you using Gradle or Maven? If you can give me the steps you are using to build that may be helpful. |
I have reproduced the issue locally (using Kafka and multiple binders). I will now try to figure out the cause @kartik-kaushik . I should have some info by the end of the weekend. |
@kartik-kaushik I will be submitting a PR in the next few hours. |
- Adds support for AOT child context generation for user-declared binder configurations.
PR submitted - here is the cause summarized: The underlying cause of this issue was two-fold.
|
- Adds support for AOT child context generation for user-declared binder configurations. Fixes spring-cloud#2655
- Adds support for AOT child context generation for user-declared binder configurations. Fixes #2655
I am trying to run a springboot3 native app with spring-cloud-stream-binder-rabbit dependency. Our application has multiple binders (e.g. usersevent, emailevent).
The normal application is working fine as expected but in native or aot-mode I am facing following issue.
When I tried with spring boot 3.0.0 and 3.0.2. the application is always taking the binder name as rabbit and connecting to localhost and not connecting to the url or binders defined in my property file
When I tried with spring boot 3.0.3-SNAPSHOT. The build failed with error
Pre-creating binder child context (AOT) for rabbit
Exception in thread "main" java.lang.IllegalArgumentException: Code generation is not supported for bean definitions declaring an instance supplier callback : Root bean: class [org.springframework.integration.config.MessagingAnnotationPostProcessor]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.(BeanDefinitionMethodGenerator.java:82)
Can someone please help in this regards.
Thanks
The text was updated successfully, but these errors were encountered: