我不能在带有Springboot项目的rocty linux 9.1中运行gradle bootBuildImage。
Caused by: java.util.MissingResourceException: Can't find bundle for base name jakarta.servlet.LocalStrings, locale en_US
at java.base@17.0.6/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2045) \~\[com.unimet.test.graalvm.GraalvmApplication:na\]
at java.base@17.0.6/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1683) \~\[com.unimet.test.graalvm.GraalvmApplication:na\]
at java.base@17.0.6/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1586) \~\[com.unimet.test.graalvm.GraalvmApplication:na\]
at java.base@17.0.6/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1549) \~\[com.unimet.test.graalvm.GraalvmApplication:na\]
at java.base@17.0.6/java.util.ResourceBundle.getBundle(ResourceBundle.java:858) \~\[com.unimet.test.graalvm.GraalvmApplication:na\]
at jakarta.servlet.GenericServlet.\<clinit\>(GenericServlet.java:51) \~\[com.unimet.test.graalvm.GraalvmApplication:6.0.0\]
... 75 common frames omitted
system:rocty linux 9.1
build:gradle 7.6
run:gradle bootBuildImage
build.gradle:
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.2'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.graalvm.buildtools.native' version '0.9.18'
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-undertow")
implementation("org.springframework.boot:spring-boot-starter-web") {
exclude module: 'spring-boot-starter-tomcat'
}
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
1条答案
按热度按时间nszi6y051#
这是由于缺少Jakarta Servlet API的元数据;本机映像正在尝试加载在构建时未包括在本机映像中的资源束。
我已经提交了a PR to fix that in the GraalVM metadata repository。
同时,您可以将以下内容添加到项目中的新文件
src/main/resources/META-INF/native-image/jakarta.servlet/jakarta.servlet-api/resource-config.json
中: