-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Document how to configure FactoryBean with a configurable target with AOT #30434
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
Thanks for the reproducer. The
I've pushed an update to your sample to demonstrate a cleaner arrangement (regardless of AOT): DanielThomas/spring-aot-issues#1 The keys are:
With those changes in place, the sample starts. We have a few things to do on our side (ping @jhoeller):
Let me know what you think. |
The raw generics felt off to me, so thanks for the pointers. Much appreciated @snicoll. |
I've created two issues:
I'll reuse this issue to document how to handle factory beans with AOT. |
@snicoll we ran into a similar issue, but with
Where
The generated definition obviously doesn't have the type parameters, so can't be wired at runtime:
What pattern do you recommend when using AOT with these? |
You should return I am not sure what you mean by "similar issue" though. Can you please check and if that is still failing, a new issue with a reproducer would be much appreciated. |
After addressing #30410 we still see failures wiring our GRPC client beans. The registration is:
With AOT enabled the application fails to start with:
Without AOT, the bean is found successfully via:
However, with AOT
FactoryBean.getObjectType()
isn't even called on theStubFactoryBean
.Example project:
https://github.com/DanielThomas/spring-aot-issues/tree/dannyt/factory-beans
Run and note the failure:
The text was updated successfully, but these errors were encountered: