quarkus: Automatic recompilation for Kotlin sources on `quarkusDev` does not work with Quarkus 2.0.0.CR3 (with gradle)
Describe the bug
When using Kotlin (1.4.32) with Quarkus 2.0.0.CR3 with a gradle build, running ./gradlew quarkusDev
builds & starts the application. When making a change to the code and accessing the application again, I expect it to recompile and restart. JVM mode here, of course.
Expected behavior
Recompilation and restart. Works with Quarkus 1.13.7.Final. (you can adjust the version in the reproducer - btw, colors don’t work as well with 2.0.0.CR3 in the console in the reproducer, just a side note).
Actual behavior
Recompilation fails with the following http response:
<!doctype html>
<html lang="en">
<head>
<title>Error restarting Quarkus - java.lang.IllegalArgumentException</title>
<meta charset="utf-8">
<style>
html, body {
margin: 0;
padding: 0;
font-family: 'Open Sans', Helvetica, Arial, sans-serif;
font-size: 100%;
font-weight: 100;
line-height: 1.4;
}
html {
overflow-y: scroll;
}
body {
background: #f9f9f9;
}
.container {
width: 80%;
margin: 0 auto;
}
.content {
padding: 1em 0 1em 0;
}
header, .component-name {
background-color: #ad1c1c;
}
ul {
line-height: 1.5rem;
margin: 0.25em 0 0.25em 0;
}
.exception-message {
background: #be2828;
}
h1, h2 {
margin: 0;
padding: 0;
}
h1 {
font-size: 2rem;
color: #fff;
line-height: 3.75rem;
font-weight: 700;
padding: 0.4rem 0rem 0.4rem 0rem;
}
h2 {
font-size: 1.2rem;
color: rgba(255, 255, 255, 0.85);
line-height: 2.5rem;
font-weight: 400;
padding: 0.4rem 0rem 0.4rem 0rem;
}
.intro { font-size: 1.2rem;
font-weight: 400;
margin: 0.25em 0 1em 0;
}
h3 {
font-size: 1.2rem;
line-height: 2.5rem;
font-weight: 400;
color: #555;
margin: 0.25em 0 0.25em 0;
}
.trace, .resources {
background: #fff;
padding: 15px;
margin: 15px auto;
border: 1px solid #ececec;
}
.trace {
overflow-y: scroll;
}
.hidden {
display: none;
}
pre {
white-space: pre;
font-family: Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace;
font-size: 12px;
line-height: 1.5;
color: #555;
}
</style>
<script>
function toggleStackTraceOrder() {
var stElement = document.getElementById('stacktrace');
var current = stElement.getAttribute('data-current-setting');
if (current == 'original-stacktrace') {
var reverseOrder = document.getElementById('reversed-stacktrace');
stElement.innerHTML = reverseOrder.innerHTML;
stElement.setAttribute('data-current-setting', 'reversed-stacktrace');
} else {
var originalOrder = document.getElementById('original-stacktrace');
stElement.innerHTML = originalOrder.innerHTML;
stElement.setAttribute('data-current-setting', 'original-stacktrace');
}
return;
}
function showDefaultStackTraceOrder() {
var reverseOrder = document.getElementById('reversed-stacktrace');
var stElement = document.getElementById('stacktrace');
if (reverseOrder == null || stElement == null) {
return;
}
// default to reverse ordered stacktrace
stElement.innerHTML = reverseOrder.innerHTML;
stElement.setAttribute('data-current-setting', 'reversed-stacktrace');
return;
}
</script>
</head>
<body onload="showDefaultStackTraceOrder()">
<header>
<h1 class="container">Error restarting Quarkus</h1>
<div class="exception-message">
<h2 class="container">java.lang.IllegalArgumentException: Invalid argument: -parameters</h2>
</div>
</header>
<div class="container content">
<div id="original-stacktrace" class="trace hidden">
<p><em><a href="" onClick="toggleStackTraceOrder(); return false;">Click Here</a> to see the stacktrace in reversed order (root-cause first)</em></p> <pre>java.lang.IllegalArgumentException: Invalid argument: -parameters
at org.jetbrains.kotlin.cli.common.CLITool.parseArguments(CLITool.kt:121)
at io.quarkus.kotlin.deployment.KotlinCompilationProvider.compile(KotlinCompilationProvider.java:79)
at io.quarkus.deployment.dev.QuarkusCompiler.compile(QuarkusCompiler.java:191)
at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.checkForChangedClasses(RuntimeUpdatesProcessor.java:584)
at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:371)
at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:350)
at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$2.handle(VertxHttpHotReplacementSetup.java:64)
at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$2.handle(VertxHttpHotReplacementSetup.java:54)
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:160)
at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:96)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:158)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)</pre>
</div>
<div id="reversed-stacktrace" class="trace hidden">
<p><em>The stacktrace below has been reversed to show the root cause first. <a href="" onClick="toggleStackTraceOrder(); return false;">Click Here</a> to see the original stacktrace</eg.IllegalArgumentException: Invalid argument: -parameters
at org.jetbrains.kotlin.cli.common.CLITool.parseArguments(CLITool.kt:121)
at io.quarkus.kotlin.deployment.KotlinCompilationProvider.compile(KotlinCompilationProvider.java:79)
at io.quarkus.deployment.dev.QuarkusCompiler.compile(QuarkusCompiler.java:191)
at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.checkForChangedClasses(RuntimeUpdatesProcessor.java:584)
at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:371)
at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:350)
at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$2.handle(VertxHttpHotReplacementSetup.java:64)
at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$2.handle(VertxHttpHotReplacementSetup.java:54)
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:160)
at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:96)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:158)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)</pre>
</div>
<div id="stacktrace"></div></div></body>
</html>
To Reproduce
I created a reproducer by just converting the reproducer for #18033 to Kotlin: https://github.com/lenalebt/quarkus-ticket-18033-reproducer/tree/kotlin
Sorry, I don’t know if this is gradle-specific at all.
- Start the compose stack with
docker-compose up
in the root directory of the reproducer - Run
./gradlew quarkusDev
in the application root. - Access the application by
curl http://localhost:8080/hello-resteasy
- Make a change to e.g.
GreetingResource.kt
(for example, add.take(1)
in line 20 at the end of the line) - Access the application by
curl http://localhost:8080/hello-resteasy
- it fails compilation.
I can easily kill the run and restart, then it works. It’s just very annoying 😕.
Environment:
Output of uname -a
or ver
Linux lena-pc 5.11.0-18-generic #19-Ubuntu SMP Fri May 7 14:22:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version “11.0.10” 2021-01-19 OpenJDK Runtime Environment GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06) OpenJDK 64-Bit Server VM GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)
Quarkus version or git rev
2.0.0-CR3
Build tool (ie. output of mvnw --version
or gradlew --version
)
Gradle 7.0
Build time: 2021-04-09 22:27:31 UTC Revision: d5661e3f0e07a8caff705f1badf79fb5df8022c4
Kotlin: 1.4.31 Groovy: 3.0.7 Ant: Apache Ant™ version 1.10.9 compiled on September 27 2020 JVM: 11.0.10 (GraalVM Community 11.0.10+8-jvmci-21.0-b06) OS: Linux 5.11.0-18-generic amd64
Additional context
(Add any other context about the problem here.)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (16 by maintainers)
Thanks @lenalebt I will have a look