{"record":{"id":"9cdd65a468832516","repo":"quarkusio/quarkus","slug":"path-method-getpath-of-method-currentcla","errorCode":null,"errorMessage":"Path '${method.getPath()}' of method '${currentClassInfo.name()}#${info.name()}' is not a valid expression","messagePattern":"Path '(.+?)' of method '(.+?)#(.+?)' is not a valid expression","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java","lineNumber":362,"sourceCode":"            invokerSupplier = endpointInvokerFactory.create(method, currentClassInfo, info);\n        }\n        method.setInvoker(invokerSupplier);\n        Set<String> methodAnnotationNames = new HashSet<>();\n        Collection<AnnotationInstance> instances = annotationStore.getAnnotations(info);\n        for (AnnotationInstance instance : instances) {\n            methodAnnotationNames.add(instance.name().toString());\n        }\n        method.setMethodAnnotationNames(methodAnnotationNames);\n\n        // validate the path\n        validateMethodPath(method, currentClassInfo, info);\n    }\n\n    private void validateMethodPath(ServerResourceMethod method, ClassInfo currentClassInfo, MethodInfo info) {\n        try {\n            new URITemplate(method.getPath(), false);\n        } catch (PatternSyntaxException e) {\n            throw new IllegalArgumentException(\"Path '\" + method.getPath() + \"' of method '\" + currentClassInfo.name() + \"#\"\n                    + info.name() + \"' is not a valid expression\", e);\n        }\n    }\n\n    @Override\n    protected InjectableBean scanInjectableBean(ClassInfo currentClassInfo, ClassInfo actualEndpointInfo,\n            Map<String, String> existingConverters, AdditionalReaders additionalReaders,\n            Map<String, InjectableBean> injectableBeans, boolean hasRuntimeConverters) {\n\n        // do not scan a bean twice\n        String currentTypeName = currentClassInfo.name().toString();\n        InjectableBean currentInjectableBean = injectableBeans.get(currentTypeName);\n        if (currentInjectableBean != null) {\n            return currentInjectableBean;\n        }\n        currentInjectableBean = new BeanParamInfo();\n        injectableBeans.put(currentTypeName, currentInjectableBean);\n","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java#L344-L380","documentation":"During deployment, validateMethodPath compiles the resolved method path (class @Path + method @Path) into a URITemplate. If the resulting template has invalid syntax — malformed {param} expressions, unbalanced braces, or an invalid regex pattern in a variable — the PatternSyntaxException is wrapped in this IllegalArgumentException and the deployment fails.","triggerScenarios":"@Path(\"/items/{id\") (unclosed brace), @Path(\"/items/{id:[a-z\") (invalid regex inside the variable), or class+method path concatenation yielding invalid syntax.","commonSituations":"Typos in path templates; hand-written custom regex constraints in variables; placeholder syntax copied from other frameworks (e.g. :id or <id>).","solutions":["Fix the @Path on the method (and class): close every {param} and make any :regex a valid Java regex.","Test the regex portion with Pattern.compile in isolation to locate the syntax error.","Replace non-JAX-RS placeholder styles with {param} syntax."],"exampleFix":"// before\n@Path(\"/users/{id\")\npublic User get(@PathParam(\"id\") long id) { ... }\n\n// after\n@Path(\"/users/{id}\")\npublic User get(@PathParam(\"id\") long id) { ... }","handlingStrategy":"validation","validationCode":"try {\n    new io.quarkus.resteasy.reactive.common.core.URITemplate(path, false);\n} catch (java.util.regex.PatternSyntaxException e) {\n    throw new IllegalStateException(\"Invalid @Path: \" + path, e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    startApplication();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"is not a valid expression\")) {\n        log.error(\"Fix the @Path template mentioned in the message\");\n    } else { throw e; }\n}","preventionTips":["Keep custom regex constraints in path variables simple and unit-tested.","Use IDE JAX-RS path validation where available.","Run a startup smoke test in CI."],"tags":["resteasy-reactive","quarkus","path","uritemplate","regex","deployment-failure"],"backgroundTag":"invalid-uri-template","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"}