为了追求学习 GraalVM + SpringBoot 的细节,我正在开发一个示例应用程序,其中只有一小部分操作和功能。其中之一是公开 SpringDoc 端点的可能性(当前使用版本 1.4.5)。即使应用程序已正确编译并且本机映像可执行文件启动,它也会在开始配置内容时引发异常:
org.springframework.beans.factory.BeanDefinitionStoreException: @Configuration classes need to be marked as proxyBeanMethods=false. Found: [org.springdoc.core.SpringDocConfigProperties, org.springdoc.core.SpringDocConfiguration, org.springdoc.core.SwaggerUiConfigParameters, org.springdoc.core.SwaggerUiConfigProperties, org.springdoc.core.SwaggerUiOAuthProperties, org.springdoc.webmvc.core.SpringDocWebMvcConfiguration, org.springdoc.webmvc.ui.SwaggerConfig]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:71) ~[poc-graalvm-native.exe:na]
我已经有以下依赖项:
implementation("org.springframework.experimental:spring-graalvm-native:0.7.1")
implementation("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.springframework:spring-context-indexer:5.2.4.RELEASE")
还有@SpringBootApplication(proxyBeanMethods = false)
我的主要课程。
对于没有 proxyBeanMethods=false 属性的 @Configuration 类的这些情况,是否有任何解决方法?
更新:似乎在 Springdoc 1.4.6-Snapshot 上更新了配置。然而,其他的事情开始抱怨:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modelConverterRegistrar' defined in class path resource [org/springdoc/core/SpringDocConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springdoc.core.converters.ModelConverterRegistrar]: Factory method 'modelConverterRegistrar' threw exception; nested exception is java.lang.NullPointerException
现在不知道该去哪里...