Quarkus: Register JAX-RS classes by default

Created on 30 Aug 2019  路  6Comments  路  Source: quarkusio/quarkus

Describe the bug
It seems that there's an issue with Jandex registration when using a Response as a response from a JAX-RS REST endpoint.

Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
        - javax.ws.rs.core.Response

Is printed on quarkus load time.

There was a similar issue when using a rest client

To Reproduce
Steps to reproduce the behavior:

  1. create a simple rest endpoint
  2. return a Response
  3. mvn clean package quarkus:dev

Environment (please complete the following information):

  • MacOS
  • GraalVM version (if different from Java): OpenJDK 64-Bit GraalVM CE 19.1.1 (build 25.222-b08-jvmci-19.1-b01, mixed mode)
  • Quarkus version or git rev: 0.21.1
kinbug

Most helpful comment

Still happens in 1.0.1.Final

All 6 comments

Can you verify with 0.27, as I think this should be fixed now

Yeah, this should have been fixed now.

Still happens in 1.0.1.Final

@FreifeldRoyi I can't reproduce this issue, using

@Path("/hello")
public class HelloResource {
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response hello() {
        return Response.ok("{\"foo\":\"bar\"}", MediaType.APPLICATION_JSON).build();
    }
}

log looks like this:

2020-01-26 14:53:00,132 INFO  [io.quarkus] (main) my-quarkus-project 1.0-SNAPSHOT (running on Quarkus 1.0.1.Final) started in 0.727s. Listening on: http://0.0.0.0:8080
2020-01-26 14:53:00,140 INFO  [io.quarkus] (main) Profile prod activated.
2020-01-26 14:53:00,141 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy]
^C2020-01-26 14:53:03,099 INFO  [io.quarkus] (main) my-quarkus-project stopped in 0.029s

For live coding mode I see just:

[INFO] --- quarkus-maven-plugin:1.0.1.Final:dev (default-cli) @ my-quarkus-project ---
Listening for transport dt_socket at address: 5005
2020-01-26 14:56:36,150 WARN  [io.qua.res.com.dep.ResteasyCommonProcessor] (build-2) Quarkus detected the need of REST JSON support but you have not provided the necessary JSON extension for this. You can visit https://quarkus.io/guides/rest-json for more information on how to set one.
2020-01-26 14:56:36,637 INFO  [io.quarkus] (main) Quarkus 1.0.1.Final started in 1.147s. Listening on: http://0.0.0.0:8080
2020-01-26 14:56:36,639 INFO  [io.quarkus] (main) Profile dev activated. Live Coding activated.
2020-01-26 14:56:36,639 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy]

^C2020-01-26 14:56:58,082 INFO  [io.quarkus] (Quarkus Shutdown Thread) Quarkus stopped in 0.003s

No mention about javax.ws.rs.core.Response in the logs

I think, the issue https://github.com/quarkusio/quarkus/issues/5871 is similar to this one. It prints also the typical Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:-message when using a Rest endpoint and returning a custom class instead of Response.

I included a reproducer in https://github.com/quarkusio/quarkus/issues/5871 so maybe it can help to solve this issue also..

Was this page helpful?
0 / 5 - 0 ratings