Re: Simple REST doesn't work

Benedic Eisenkrämer <[email protected]> Mon, 30 Sep 2024 22:51:38 +0200
Newsgroups gmane.comp.java.openejb.user
Message-ID <0ac03d9b-4e86-4113-b106-23832a26d9e3__35084.1638328106$1727729524$gmane$org@eisenkramer.de>
Hi Fernando,

did you create an implementation of the Application-Class and Annotated 
it with @ApplicationPath? That is how I have always done it.

I believe you need to create some Servlet mappings otherwise, maybe have 
a look at 
https://jakarta.ee/specifications/restful-ws/3.0/jakarta-restful-ws-spec-3.0#servlet

~ Benedict


Am 30.09.24 um 22:28 schrieb Fernando:
> Hi all!,
> I am trying to implement a very simple rest web service following the guide:
> https://tomee.apache.org/tomee-8.0/examples/simple-rest.html
>
> and this is my code:
>
> @Path(" articuloservice ")
> public class ArticulosService {
>
>      @Inject
>      private ArticuloDao articuloDao;
>
>      @GET
>      @Path("/saludar")
>      @Produces(MediaType.TEXT_PLAIN)
>      public String Saludo() {
>          return "Helloooo!";
>      }
> }
>
> I am trying to test the code using postman  (GET) :
> *http://localhost:8080/Hiper/articuloservice/saludar
> <http://localhost:8080/Hiper/articuloservice/saludar>*
>
> getting the following response: "*The required resource is not available*"
>
> Maybe I am missing something?...any idea?
> Thanks in advance!
> Fernando
>