I have a Quarkus application that runs without any problems with ./gradlew quarkusDev
.
However if I try to build the application, and it makes no difference if I use quarkusBuild
, buildNative
or build
, the ClassVisitor
throws a lot of IllegalArgumentException
s for these classes / methods (for brevity omitting similar stack traces after first exception):
Execution failed for task ':quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.deployment.steps.ConfigBuildSteps#generateConfigSources threw an exception: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
at io.quarkus.gizmo.GizmoClassVisitor.<init>(GizmoClassVisitor.java:22)
at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:150)
at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:203)
at io.quarkus.deployment.steps.ConfigBuildSteps.generateConfigSources(ConfigBuildSteps.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[error]: Build step io.quarkus.deployment.steps.BootstrapConfigSetupBuildStep#setupBootstrapConfig threw an exception: java.lang.IllegalArgumentException
// ... (Stacktrace omitted for brevity)
[error]: Build step io.quarkus.deployment.logging.LoggingResourceProcessor#registerMetrics threw an exception: java.lang.IllegalArgumentException
// ... (Stacktrace omitted for brevity)
[error]: Build step io.quarkus.netty.deployment.NettyProcessor#eagerlyInitClass threw an exception: java.lang.IllegalArgumentException
// ... (Stacktrace omitted for brevity)
[error]: Build step io.quarkus.deployment.logging.LoggingResourceProcessor#setupLoggingStaticInit threw an exception: java.lang.IllegalArgumentException
// ... (Stacktrace omitted for brevity)
[error]: Build step io.quarkus.vertx.http.deployment.HttpSecurityProcessor#initBasicAuth threw an exception: java.lang.IllegalArgumentException
// ... (Stacktrace omitted for brevity)
[error]: Build step io.quarkus.vertx.http.deployment.HttpSecurityProcessor#initMtlsClientAuth threw an exception: java.lang.IllegalArgumentException
// ... (Stacktrace omitted for brevity)
[error]: Build step io.quarkus.vertx.core.deployment.VertxCoreProcessor#ioThreadDetector threw an exception: java.lang.IllegalArgumentException
// ... (Stacktrace omitted for brevity)
Does anyone know what is causing these exceptions and how to solve this?
I am using Quarkus 1.9.2.Final, Kotlin 1.4.10, Gradle 6.5 and JDK 11.
Below are my application.properties and my build.gradle:
quarkus.http.port=6543
quarkus.native.enable-https-url-handler=true
quarkus.native.enable-all-security-services=true
plugins {
id 'org.jetbrains.kotlin.jvm'
id "org.jetbrains.kotlin.plugin.allopen" version "1.4.10"
id 'io.quarkus'
}
def javaVersion = JavaVersion.VERSION_11
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
compileKotlin {
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.javaParameters = true
}
compileTestKotlin {
kotlinOptions.jvmTarget = javaVersion
}
dependencies {
implementation enforcedPlatform("io.quarkus:quarkus-universe-bom:$quarkusVersion")
implementation 'io.quarkus:quarkus-kotlin'
implementation 'io.quarkus:quarkus-resteasy'
implementation 'io.quarkus:quarkus-resteasy-jackson'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
testImplementation 'io.quarkus:quarkus-junit5'
testImplementation 'io.rest-assured:rest-assured'
}
quarkus {
setOutputDirectory("$projectDir/build/classes/kotlin/main")
}
quarkusDev {
setSourceDir("$projectDir/src/main/kotlin")
}
allOpen {
annotation("javax.ws.rs.Path")
annotation("javax.enterprise.context.ApplicationScoped")
annotation("io.quarkus.test.junit.QuarkusTest")
}
test {
useJUnitPlatform()
}