-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
InstantiationAwareBeanPostProcessor implementations are not invoked with an AOT-processed context #28777
Comments
I am not sure I got all those pieces together. Can you please share how I can reproduce this myself? Also, if that exception below is happening at build time, I don't think that's right. We shouldn't be instantiating beans at build time like that. |
@snicoll build either the |
Can you clarify that the bean is instantiated at build time and why that is ? |
The bean serves as an entry point for domain type inspection of the data module which will add reflection configuration etc. |
What happens is that We're in a weird state right now as we're not actively preventing beans to be instantiated, but the configuration of the |
I have some code that supports the use case described above. This also includes honoring autowired injection points as well as initialization in case the I've kept the very conservative approach to only include Current code (and test) are available in 35da93c |
This comment was marked as outdated.
This comment was marked as outdated.
Having tried to fix the problem above in several ways, we've decided to resort to a double invocation of MBDPP if a bean is instantiated at build-time. |
Obtaining a bean provided by a configuration class that has dependencies caused trouble during AOT processing.
The Boot Configuration for
JdbcRepositoriesAutoConfiguration
contains a conditional configuration classSpringBootJdbcConfiguration
depending on theApplicationContext
.The
AbstractJdbcConfiguration
exposes a bean of typeRelationalManagedTypes
Obtaining
jdbcManagedTypes
viaregisteredBean.getBeanFactory().getBean(registeredBean.getBeanName(), ManagedTypes.class))
within aBeanRegistrationAotProcessor
errors withThe text was updated successfully, but these errors were encountered: