quarkus: Build fails with Kotlin coroutine/suspend methods
Describe the bug
With latest release the build fails with this error message:
Build step io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor#setupEndpoints threw an exception: java.lang.RuntimeException: java.lang.RuntimeException: Failed to process method 'io.outfoxx.cloud.api.admin.server.AdminAPI#createAccount'
and the final cause error message is:
Resource method java.lang.Object createAccount(java.lang.String tenantId, io.outfoxx.cloud.api.CreateAccountParams body, javax.ws.rs.core.UriInfo uriInfo, kotlin.coroutines.Continuation<? super javax.ws.rs.core.Response> $completion) can only have a single body parameter: $completion
Notice the complaint about the $completion
parameter in the method.
The suspend method is defined in an interface with the following signature:
@Path(value = "/admin/api/v1.0")
@Produces(value = ["application/json","application/cbor"])
@Consumes(value = ["application/json"])
interface AdminAPI
//...
@POST
@Path(value = "/tenants/{tenantId}/accounts")
public suspend fun createAccount(
@PathParam(value = "tenantId") tenantId: String,
@Valid body: CreateAccountParams,
@Context uriInfo: UriInfo
): Response
//...
}
An implementation class then derives from the interface and implements the methods. It builds fine in 2.13.0.Final
Expected behavior
Kotlin suspend methods work as they did in previous releases.
Actual behavior
Kotlin suspend methods in interfaces fails the
How to Reproduce?
No response
Output of uname -a
or ver
macOS 12.6
Output of java -version
OpenJDK 17.0.1
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.13.1.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Gradle 7.5
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (20 by maintainers)
Commits related to this issue
- Add a test for regression reported in #28440 — committed to gsmet/quarkus by gsmet 2 years ago
- Add a test for regression reported in #28440 — committed to gsmet/quarkus by gsmet 2 years ago
- Add a test for regression reported in #28440 — committed to Eng-Fouad/quarkus by gsmet 2 years ago
- Add a test for regression reported in #28440 — committed to tmihalac/quarkus by gsmet 2 years ago
- Add a test for regression reported in #28440 (cherry picked from commit 521b13e3eb7dd4bee1d3934530666e0831669186) — committed to gsmet/quarkus by gsmet 2 years ago
- Add a test for regression reported in #28440 (cherry picked from commit 521b13e3eb7dd4bee1d3934530666e0831669186) — committed to zakkak/quarkus by gsmet 2 years ago
Yep it was the clean that was needed. For posterity here is my reproducer that generates the same error.
code-with-quarkus.zip