Problem is deploying REST Web service with Tomee

128 Views Asked by At

I try to deploy a REST web service on my tomee. i use apache-tomee-plus-8.0.6 with JDK 15

I create a web application called test I create a class like this:

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("/test")
public class WebServiceApplication extends Application {
        @Override
        public Set<Class<?>> getClasses() {
                return new HashSet<Class<?>>(Arrays.asList(QueueContentWebService.class));
        }
}

And another like this:

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/queuecontent")
public class QueueContentWebService {
       
    @POST
    public Response getContent() {
    return Response.status(200).entity("getContent is called").build();
    }
}

Then i try this URL, with a browser and with postman in POST: http://localhost:8080/test/test/queuecontent/

I only get 404 response... It seems that my web service is not deployed. Anybody can help me by saying what is missing?

0

There are 0 best solutions below