RE: Some issues with simple rest application
COURTAULT Francois <[email protected]> Tue, 2 Apr 2024 11:07:00 +0000
| Newsgroups | gmane.comp.java.openejb.user |
|---|---|
| Message-ID | <MR1P264MB2355F164B273981B4791A7DE9D3E2@MR1P264MB2355.FRAP264.PROD.OUTLOOK.COM> |
THALES GROUP LIMITED DISTRIBUTION to email recipients
Hello everyone,
I posted "Second issue with simple rest application on TomEE 9.1.2".
In fact I deployed the very same application on TomEE 8.0.16 micro-profile flavor.
The output is not the same (see below).
02-Apr-2024 12:58:44.825 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints REST Application: http://localhost:8080/JAXRS/ -> org.apache.openejb.server.rest.InternalApplication@149238fe
02-Apr-2024 12:58:44.827 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints Service URI: http://localhost:8080/JAXRS/health -> Pojo org.apache.geronimo.microprofile.impl.health.cdi.CdiHealthChecksEndpoint
02-Apr-2024 12:58:44.827 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/health -> Response getChecks()
02-Apr-2024 12:58:44.830 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints Service URI: http://localhost:8080/JAXRS/metrics -> Pojo org.apache.geronimo.microprofile.metrics.jaxrs.CdiMetricsEndpoints
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/metrics -> Object getJson(SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/metrics -> String getText(SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/metrics/{registry} -> Object getJson(String, SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/metrics/{registry} -> String getText(String, SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/metrics/{registry}/{metric} -> Object getJson(String, String, SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/metrics/{registry}/{metric} -> String getText(String, String, SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints OPTIONS http://localhost:8080/JAXRS/metrics/{registry} -> Object getMetadata(String, SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints OPTIONS http://localhost:8080/JAXRS/metrics/{registry}/{metric} -> Object getMetadata(String, String, SecurityContext, UriInfo)
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints Service URI: http://localhost:8080/JAXRS/myresource -> Pojo jaxrs.skeleton.MyResource
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/myresource -> Response test()
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints Service URI: http://localhost:8080/JAXRS/openapi -> Pojo org.apache.geronimo.microprofile.openapi.jaxrs.OpenAPIEndpoint
02-Apr-2024 12:58:44.831 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints GET http://localhost:8080/JAXRS/openapi -> OpenAPI get()
This time I am able to see a GET on a path with myresource 😊
So big issue on TomEE 9.1.2 micro-profile ?
Best Regards.
-----Original Message-----
From: COURTAULT Francois <[email protected]>
Sent: mardi 2 avril 2024 09:50
To: [email protected]
Subject: RE: Some issues with simple rest application
THALES GROUP LIMITED DISTRIBUTION to email recipients
Hello Kean,
I am using TomEE 9.1.2 microprofile flavor.
In the conf/system.properties file, I have this line tomee.mp.scan = all So it's not due to this lack of this property unfortunately.
Thanks for trying to help me.
I am able to provide you the war if needed.
Best Regards.
-----Original Message-----
From: Kean Erickson <[email protected]>
Sent: lundi 1 avril 2024 23:25
To: [email protected]
Subject: Re: Some issues with simple rest application
If you're on tomee plus or plume, there is a system.proprties flag needed to turn on the automatic resource scanning
tomee.mp.scan = all
On Mon, Apr 1, 2024, 1:16 PM COURTAULT Francois <[email protected]> wrote:
> 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.
>
>
>
>