Some issues with simple rest application

COURTAULT Francois <[email protected]> Mon, 1 Apr 2024 20:15:52 +0000
Newsgroups gmane.comp.java.openejb.user
Message-ID <MR1P264MB23558E3102804C6F21386ECA9D3F2@MR1P264MB2355.FRAP264.PROD.OUTLOOK.COM>
THALES GROUP LIMITED DISTRIBUTION to email recipients

Hello everyone,

After having read the Jakarta Restful 3.0 specification.
I want to check how it works.

For that I have built a web application (war) without any Application subclass.
According to the specification, I have to add a servlet with the name jakarta.ws.rs.core.Application in web.xml.
In the war, I have:

  *   a Root resource named MyResource
@Path("myresource")

public class MyResource {

    @GET

   public Response test () {

        return Response.ok().build();

    }

}

  *   web.xml with the following section
    <servlet>

        <servlet-name>jakarta.ws.rs.core.Application</servlet-name>

    </servlet>

    <servlet-mapping>

        <servlet-name>jakarta.ws.rs.core.Application</servlet-name>

        <url-pattern>/myapp/*</url-pattern>

    </servlet-mapping>

Pb when I start up tomee-microprofile 9.1.2, I see:
01-Apr-2024 21:42:21.835 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints      Service URI: http://localhost:8080/JAXRS/myapp/health         -> Pojo org.apache.tomee.microprofile.health.MicroProfileHealthChecksEndpoint
01-Apr-2024 21:42:21.835 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/JAXRS/myapp/health         ->      Response getChecks()
01-Apr-2024 21:42:21.835 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/JAXRS/myapp/health/live    ->      Response getLiveChecks()
01-Apr-2024 21:42:21.835 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/JAXRS/myapp/health/ready   ->      Response getReadyChecks()
01-Apr-2024 21:42:21.835 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/JAXRS/myapp/health/started ->      Response getStartedChecks()

No GET on a path with myresource ☹
What’s wrong in my understanding  of the spec (“REQUIRED …. and to automatically discover all root resource classes …”) ?

Best Regards.