-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error: java.lang.IllegalAccessError: class io.micronaut.buffer.netty.NettyFeature (in unnamed module @0x5f90a2ee) cannot access class com.oracle.svm.core.jdk.SystemPropertiesSupport (in module org.graalvm.nativeimage.builder) because module org.graalvm.nativeimage.builder does not export com.oracle.svm.core.jdk to unnamed module @0x5f90a2ee #8160
Comments
Can you try with Micronaut 3.7.1? If it keeps failing, post your build.gradle. |
You should use |
Still failing after upgrading to what is failing?
build.gradle.ktsplugins {
id("org.jetbrains.kotlin.jvm") version "1.6.21"
id("org.jetbrains.kotlin.kapt") version "1.6.21"
id("org.jetbrains.kotlin.plugin.allopen") version "1.6.21"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.micronaut.application") version "3.6.0"
id("io.micronaut.aot") version "3.6.0"
}
version = "0.1"
group = "com.example.app"
val kotlinVersion = project.properties["kotlinVersion"]
val jsoupVersion = project.properties["jsoupVersion"]
val reactorKotlinExtensionsVersion = project.properties["reactorKotlinExtensionsVersion"]
repositories {
mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
kapt("io.micronaut:micronaut-http-validation")
kapt("io.micronaut.openapi:micronaut-openapi")
kapt("io.micronaut.security:micronaut-security-annotations")
kapt("io.micronaut.serde:micronaut-serde-processor")
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut:micronaut-jackson-databind")
implementation("io.micronaut.cache:micronaut-cache-ehcache")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut.reactor:micronaut-reactor")
implementation("io.micronaut.reactor:micronaut-reactor-http-client")
implementation("io.micronaut.security:micronaut-security-jwt")
implementation("io.micronaut.serde:micronaut-serde-jackson")
implementation("io.swagger.core.v3:swagger-annotations")
implementation("jakarta.annotation:jakarta.annotation-api")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
runtimeOnly("ch.qos.logback:logback-classic")
compileOnly("org.graalvm.nativeimage:svm")
implementation("io.micronaut:micronaut-validation")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions:$reactorKotlinExtensionsVersion")
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
// Custom dependencies
implementation("org.jsoup:jsoup:$jsoupVersion")
}
application {
mainClass.set("com.example.app.ApplicationKt")
}
java {
sourceCompatibility = JavaVersion.toVersion("17")
}
tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
}
graalvmNative.toolchainDetection.set(false)
micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("com.example.app.*")
}
aot {
// Please review carefully the optimizations enabled below
// Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details
optimizeServiceLoading.set(true)
convertYamlToJava.set(true)
precomputeOperations.set(true)
cacheEnvironment.set(true)
optimizeClassLoading.set(true)
deduceEnvironment.set(true)
optimizeNetty.set(true)
}
}
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("io.micronaut:micronaut-jackson-databind"))
.using(module("io.micronaut.serde:micronaut-serde-jackson:1.3.2"))
}
} gradle.properties
|
@burtbeckwith error stacktrace
this error only occurs when running the native app. |
It wasn't a Micronaut build issue,
|
Expected Behavior
Native image is created
Actual Behaviour
I assemble the jar with
./gradlew assemble
, then when trying to build the native image:native-image --no-server -cp build/libs/example-0.1-all.jar com.example.ApplicationKt
,I get the following error message:
Steps To Reproduce
No response
Environment Information
micronautVersion=3.7.0-SNAPSHOT
kotlinVersion=1.6.10
jsoupVersion=1.15.3
reactorKotlinExtensionsVersion=1.1.7
Example Application
No response
Version
3.7.0-SNAPSHOT
The text was updated successfully, but these errors were encountered: