我试图使用spring boot和GraalVM本机映像创建一个示例应用程序,但是,当我为Springdoc添加依赖项时,由于以下原因,生成的可执行文件不再工作:
java.lang.IllegalStateException: Error processing condition on org.springdoc.core.SpringDocConfiguration.springdocBeanFactoryPostProcessor2
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[poc-graalvm-native.exe:na]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[na:na]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:184) ~[na:na]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144) ~[na:na]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) ~[na:na]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[poc-graalvm-native.exe:na]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236) ~[poc-graalvm-native.exe:na]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:280) ~[na:na]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:96) ~[na:na]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707) ~[na:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533) ~[na:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[na:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[poc-graalvm-native.exe:na]
at c.b.t.graal.GraalVMApplicationPoc.main(GraalVMApplicationPoc.java:31) [poc-graalvm-native.exe:na]
Caused by: java.lang.IllegalStateException: java.io.FileNotFoundException: class path resource [org/springdoc/core/CacheOrGroupedOpenApiCondition$OnCacheDisabled.class] cannot be opened because it does not exist
at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.getMetadata(AbstractNestedCondition.java:149) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.getMemberConditions(AbstractNestedCondition.java:121) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.<init>(AbstractNestedCondition.java:114) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition.getMatchOutcome(AbstractNestedCondition.java:62) ~[poc-graalvm-native.exe:na]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[poc-graalvm-native.exe:na]
... 18 common frames omitted
Caused by: java.io.FileNotFoundException: class path resource [org/springdoc/core/CacheOrGroupedOpenApiCondition$OnCacheDisabled.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[poc-graalvm-native.exe:na]
at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55) ~[na:na]
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49) ~[na:na]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[na:na]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[na:na]
at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.getMetadata(AbstractNestedCondition.java:146) ~[poc-graalvm-native.exe:na]
... 22 common frames omitted
dependencies {
implementation ('org.springframework.boot:spring-boot-starter-web') {
exclude group : 'org.apache.tomcat.embed', module : 'tomcat-embed-websocket'
}
implementation("org.springframework.boot:spring-boot-starter-actuator")
// Lombok
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
// https://mvnrepository.com/artifact/org.slf4j/jcl-over-slf4j
implementation('org.slf4j:jcl-over-slf4j:2.0.0-alpha1')
implementation('org.springdoc:springdoc-openapi-webmvc-core:1.4.4')
}
dependencies {
implementation ('org.springframework.boot:spring-boot-starter-web') {
exclude group : 'org.apache.tomcat.embed', module : 'tomcat-embed-websocket'
}
implementation("org.springframework.boot:spring-boot-starter-actuator")
// Lombok
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
// https://mvnrepository.com/artifact/org.slf4j/jcl-over-slf4j
implementation('org.slf4j:jcl-over-slf4j:2.0.0-alpha1')
implementation('org.springdoc:springdoc-openapi-webmvc-core:1.4.4')
}
如有任何提示,不胜感激。
因为v1.5.9
,SpringDoc-OpenAPI完全支持带有Spring-Native的GraalVM。
不需要额外的配置。
GitHub上的基板虚拟机文档(例如CONFIGURE.md提到了多个<code>-H:…</code>选项,如<code>H:ReflectionConfigurationResources
我正在尝试用Dockers创建一个GraalVM本地映像。我已经创建了一个Micronaut项目,并成功创建了jar应用程序,并在docker中运行;此外,我已经用这个jar文件创建了一个GraalVM本机映像,现在可以运行这个应用程序,但我需要在docker中运行一个GraalVM本机映像,在论坛中寻找答案。我发现有必要在docker中构建本机映像。因此我尝试了这个docker文件: 它不会抛出
我在这里将Micronaut应用程序作为Graalvm本地映像进行试用。
我正在尝试使用graalVM v20.0.0CE创建一个简单的hello world本地映像。 最初,我收到了一个“本机工具链”错误,但从“x86 Native Tools Command Prompt for VS2017”启动了一个命令行,我就克服了这个障碍。 现在的问题是一串链接器错误: java.lib(jni_util.obj):错误LNK2019:函数jni _打印字符串中引用了未解析
失败:生成失败,出现异常。 错误:执行任务“:QuarkusBuild”失败。Io.Quarkus.Builder.BuildException:生成失败:由于错误导致生成失败[error]:生成步骤Io.Quarkus.Deployment.Pkg.Steps.NativeImageBuildStep#Build引发异常:java.lang.RuntimeException:未能在io.Quar
在哪里可以找到使用 -H:配置文件目录设置的 GraalVM 配置文件的文档/模式