{"record":{"id":"6cd0aa02a4006cfd","repo":"quarkusio/quarkus","slug":"unable-to-find-matching-target-resource-method","errorCode":null,"errorMessage":"Unable to find matching target resource method","messagePattern":"Unable to find matching target resource method","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ClassRoutingHandler.java","lineNumber":134,"sourceCode":"            if (pathParamValue == null) {\n                break;\n            }\n            requestContext.setPathParamValue(i + parameterOffset, pathParamValue);\n        }\n    }\n\n    private void throwNotFound(ResteasyReactiveRequestContext requestContext) {\n        ProvidersImpl providers = requestContext.getProviders();\n        ExceptionMapper<NotFoundException> exceptionMapper = providers.getExceptionMapper(NotFoundException.class);\n\n        if (exceptionMapper == null || servletPresent) {\n            if (requestContext.resumeExternalProcessing()) {\n                return;\n            }\n        }\n        // the exception mapper needs access to request scoped beans, so make sure we have the context\n        requestContext.requireCDIRequestScope();\n        throw new NotFoundException(\"Unable to find matching target resource method\");\n\n    }\n\n    private String getRemaining(ResteasyReactiveRequestContext requestContext) {\n        return requestContext.getRemaining().isEmpty() ? \"/\" : requestContext.getRemaining();\n    }\n\n    public Map<String, RequestMapper<RuntimeResource>> getMappers() {\n        return mappers;\n    }\n}\n","sourceCodeStart":116,"sourceCodeEnd":146,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ClassRoutingHandler.java#L116-L146","documentation":"ClassRoutingHandler dispatches a request to a resource method once the class has been matched. When no method template matches the remaining path, HTTP method, and content/accept types, it throws NotFoundException (404) 'Unable to find matching target resource method' after giving other routes a chance to process it.","triggerScenarios":"Path matches the resource class but no method matches: wrong sub-path, wrong HTTP verb, missing/incorrect @Consumes or @Produces for the request's Content-Type/Accept, or a trailing-slash/encoding difference.","commonSituations":"Typos in @Path; calling POST on a GET-only endpoint; sending Content-Type the method's @Consumes doesn't include (415 disguised as 404 in class-level routing); missing @Path on the method; case-sensitive path segments; application not reloaded after adding the method.","solutions":["Verify the exact request path, verb and Content-Type against the resource's @Path/@GET-@POST/@Consumes/@Produces annotations.","Add the missing @Consumes (e.g. application/json) or @Produces so the method matches the request's headers.","Check for trailing slash or context-root mismatch; compare with Dev UI / swagger-ui route listing.","Ensure the application was rebuilt/restarted after adding or changing resource methods.","Add a @Produces/@Consumes wildcard (e.g. @Consumes(MediaType.APPLICATION_JSON) on client side) or a catch-all method to see routing reach the class."],"exampleFix":"// before\n@POST @Path(\"/items\")\npublic Item create(Item i) { ... }   // client sends no Content-Type\n// after (client)\ncurl -X POST -H 'Content-Type: application/json' -d '{...}' /items","handlingStrategy":"try-catch","validationCode":"// client-side pre-check that route shape matches\nURI u = URI.create(baseUri + \"/items/42\");\nif (!u.getPath().matches(\".*/items/[^/]+$\")) throw new IllegalArgumentException(\"Path does not match /items/{id}\");","typeGuard":null,"tryCatchPattern":"try {\n    return client.target(url).request().get();\n} catch (NotFoundException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Unable to find matching target resource method\")) {\n        log.errorf(\"Route mismatch: check path/verb/Content-Type for %s %s\", method, url);\n    }\n    throw e;\n}","preventionTips":["Cross-check @Path/@GET-@POST/@Consumes/@Produces against client calls.","Use swagger-ui or the Dev UI route list to verify registered endpoints.","Send explicit Content-Type matching @Consumes.","Rebuild/reload after adding methods (dev mode live reload can miss annotation-only changes occasionally)."],"tags":["resteasy-reactive","routing","http-404","not-found"],"backgroundTag":"no-matching-resource-method","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}