kc2001
kc2001

Reputation: 5249

Debugging cause of 404 (not found) response from Jakarta RS services on JBoss EAP 8.0

I’m migrating our web application from JBoss EAP 6.4 to JBoss EAP 8.0. This involves updating quite a few dependencies and making multiple configuration changes. The migration has not gone well.

My big problem is that JBoss EAP 8.0 doesn't seem to be aware of pages being generated from classes annotated with Jakarta-EE annotations, although I can hit our lone static page. I have downloaded the JBoss EAP 8.0 quick start applications and they build and run fine, including the jaxrs-client application, whose Jakarta-EE annotations are quite similar to ours. Here is how our Jakarta Application subclass is annotated:

import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/rest")
public class RestApplication extends Application {
    @Override
    public Set<Class<?>> getClasses() {
        Set<Class<?>> classes = new HashSet<Class<?>>();
        classes.add(DriveService.class);
        // …
        return classes;
    }

and this is part of one of the classes that provides services:

@Path("drives")
public class DriveService extends BaseDriveService {

@GET
public Response forDebugging() {
   return populateSuccessResponse();
}

@GET
@Path("list")
public Response listDrives(@Context HttpServletRequest request) { /*… */ }

// …

}

Intellij IDEA seems to think that I have the end point defined:

enter image description here

Yet, when I try to list the drives from curl, I get a 404 (not found).

curl -v -u XXX:YYY http://localhost:8080/cse.webui-3.1.4-SNAPSHOT/rest/drives/list

I am at a loss of how to debug this. I have set the log level on several key packages to spew out lots of debug information. Below is some of the output. One odd thing is that I see lots of messages from the jboss, weld, and undertow packages, but nothing interesting from "our" code or from jakarta. It sure would be nice if somebody could suggest a debugging step that would help pinpoint the configuration problem. The most interesting log output I've seen is the second message below, which may indicate that a resource isn't found due to faulty caching(?).

DEBUG [io.undertow.request] (default I/O-12) Matched prefix path /cse.webui-3.1.4-SNAPSHOT for path /cse.webui-3.1.4-SNAPSHOT/rest/drives  
TRACE [io.undertow.server.handlers.resource.PathResourceManager] (default I/O-12) Failed to get path resource rest/drives from path resource manager with base C:\Tools\JBoss\EAP-8.0.0\standalone\tmp\vfs\temp\tempdec1b89bde46b117\content-5c493cd03e5d3b46\, as the path did not exist 
TRACE [org.jboss.weld.Servlet] (default task-1) WELD-000708: Initializing request HttpServletRequestImpl [ GET /cse.webui-3.1.4-SNAPSHOT/rest/drives ]

Upvotes: 0

Views: 185

Answers (0)

Related Questions