我有bean DSL如下:
class BeansInitializer : ApplicationContextInitializer<GenericApplicationContext> {
override fun initialize(applicationContext: GenericApplicationContext) {
beans {
bean {
ref<Jackson2ObjectMapperBuilder>().build()
}
// ...
在processAot
中,我得到以下异常:
Exception in thread "main" java.lang.IllegalArgumentException:
Code generation is not supported for bean definitions declaring an instance supplier callback :
Root bean: class [com.fasterxml.jackson.databind.ObjectMapper]; 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.<init>(BeanDefinitionMethodGenerator.java:82)
1条答案
按热度按时间olmpazwi1#
令人遗憾和惊讶的是,Spring中不支持此功能。
https://github.com/spring-projects/spring-framework/issues/29555