I followed a tutorial and the project don't work. When I deploy the war in tomcat and access the address http://localhost:8080/queroquero/rest/vendedor/get I have 404 status, but if I access http://localhost:8080/queroquero/ I get a "Hello world".
@ApplicationPath("rest")
public class Main extends Application{ }
---------------------------------------------
@Path("vendedor")
public class VendedorResource {
@GET
@Path("get")
@Produces(MediaType.APPLICATION_JSON)
public Response get() {
String texto = new String("It's working!!!");
return Response.ok(texto).build();
}
}
My POM.xml dependencies:
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.7</version>
</dependency>
</dependencies>
My web.xml:
<web-app>
<display-name>Archetype Created Web Application</display-name>
<!-- Auto scan REST service -->
</web-app>
I'm already spent hours and cannot find what is wrong or missing.