I have a project developed using maven, resteasy-3.0.24.Final, wildfly 11.
When I tried to access one of the end point using postman, I got a 404 error.
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-servlet-initializer</artifactId>
<version>3.0.24.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.24.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.24.Final</version>
</dependency>
web.xml - I think it is not necessary for wildfly11
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>Library</display-name>
<display-name>Library</display-name>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/rest</param-value>
</context-param>
</web-app>
def-
@ApplicationPath("/rest")
public class LibraryApplication extends Application {
private Set<Object> singletons = new HashSet<Object>();
public LibraryApplication() {
singletons.add(new BookResource());
}
@Override
public Set<Object> getSingletons() {
return singletons;
}
}
resource
@Path("/bookResource")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public class BookResource {
@Inject
private LibrarianEntityManager manager;
@Path("/addBook")
@POST
public Response addBook(BookModel bookModel) {}
I tried to access http://localhost:8080/Library-management/rest/bookResource/addBook but no luck. And none of the endpoints defined in Standalone Server Monitor: Subsystems Subsystem: Web Services.
Any help would be highly appreciated. Thanks in advance.
Note: I was able to deploy this project in tomcat and it did working fine.