【发布时间】:2020-12-21 07:31:52
【问题描述】:
为了了解 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
不知道现在该去哪里......
【问题讨论】:
标签: spring-boot graalvm springdoc graalvm-native-image springdoc-openapi-ui