I generated a project with the following fractions:
CDI, JAX-RS, DataSources, MP+OpenAPI
The resulting project had a HelloWorldEndpoint JAX-RS class like this:
@ApplicationScoped
@Path("/hello")
public class HelloWorldEndpoint {
@GET
@Produces("text/plain")
public Response doGet() {
return Response.ok("Hello from WildFly Swarm!").build();
}
}
However there was no web.xml defined (fine) and no JAX-RS application class defined (not fine).
In order to properly start, there should be either a web.xml with a resteasy servlet defined or a JAX-RS application class defined. Like this:
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationScoped
@ApplicationPath("/")
public class HelloWorldApplication extends Application {
}
I generated a project with the following fractions:
CDI, JAX-RS, DataSources, MP+OpenAPI
The resulting project had a
HelloWorldEndpoint
JAX-RS class like this:However there was no
web.xml
defined (fine) and no JAX-RS application class defined (not fine).In order to properly start, there should be either a web.xml with a resteasy servlet defined or a JAX-RS application class defined. Like this:
Clearly the latter option is better. :)