Quarkus Resources Not Found When the same path annotation is located in two different classes

Viewed 1562

I am running in a strange beahvior of Qurkus Rest Api.

I have two different classes annotated with the same root path.

@Path("/hello")
public class HelloManResource {
@GET
@Path("/man")
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        log.info("Hello Man");
        return "hello man!";
    }
}

@Path("/hello")
public class HelloDudeResource {
@GET
@Path("/dude")
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        log.info("Hello Dude");
        return "hello dude!";
    }
}

When I make a call to the two endpoints I get the 404 Resource Not Found Error.

I have try to change the hello enpoints to hello1 and hello2 and all works fine.

I can't understand what I am doing wrong. Maybe Quarkus dosen't allow to use the same enpoint annotation in different classes?

Actually I have solved the problem putting all the methods under the same class, but this solution is not so elegant.

0 Answers
Related