{"record":{"id":"480ed902421cd9b8","repo":"quarkusio/quarkus","slug":"this-method-is-not-supported-using-this-builder-u","errorCode":null,"errorMessage":"This method is not supported using this builder. Use #routeFunction(String, Consumer<Route>)","messagePattern":"This method is not supported using this builder\\. Use #routeFunction\\(String, Consumer<Route>\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/HttpRootPathBuildItem.java","lineNumber":116,"sourceCode":"    }\n\n    public HttpRootPathBuildItem.Builder routeBuilder() {\n        return new HttpRootPathBuildItem.Builder(this);\n    }\n\n    public static class Builder extends RouteBuildItem.Builder {\n        private final HttpRootPathBuildItem buildItem;\n        private RouteType routeType = RouteType.APPLICATION_ROUTE;\n        private RouteType routerType = RouteType.APPLICATION_ROUTE;\n        private String path;\n\n        private Builder(HttpRootPathBuildItem buildItem) {\n            this.buildItem = buildItem;\n        }\n\n        @Override\n        public Builder routeFunction(Function<Router, Route> routeFunction) {\n            throw new RuntimeException(\n                    \"This method is not supported using this builder. Use #routeFunction(String, Consumer<Route>)\");\n        }\n\n        public Builder orderedRoute(String route, Integer order) {\n            route = super.absolutePath = buildItem.resolvePath(route);\n\n            if (route.startsWith(buildItem.getRootPath())) {\n                // relative to http root (leading slash for vert.x route)\n                this.path = \"/\" + UriNormalizationUtil.relativize(buildItem.getRootPath(), route);\n                this.routerType = RouteType.APPLICATION_ROUTE;\n            } else if (route.startsWith(\"/\")) {\n                // absolute path\n                this.path = route;\n                this.routerType = RouteType.ABSOLUTE_ROUTE;\n            }\n\n            BasicRoute basicRoute = new BasicRoute(this.path, order);\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/HttpRootPathBuildItem.java#L98-L134","documentation":"The Builder obtained from HttpRootPathBuildItem.routeBuilder() deliberately forbids the inherited routeFunction(Function<Router, Route>) overload because raw router access would bypass the resolved root path handling. Calling it throws RuntimeException directing developers to the root-path-aware routeFunction(String, Consumer<Route>) variant.","triggerScenarios":"Calling buildItem.routeBuilder().routeFunction(router -> router.route(...)) on the HttpRootPathBuildItem-provided Builder; the override throws immediately at build time.","commonSituations":"Copy-pasting route registration code written against the plain RouteBuildItem/Router API and reusing it inside an HttpRootPathBuildItem builder; migrating code that previously used a raw Router and now builds routes relative to the configured root path.","solutions":["Use routeFunction(String path, Consumer<Route> consumer) on the builder instead","Pass the route path relative to the root and configure the Route inside the Consumer","If raw router manipulation is truly needed, produce a RouteBuildItem directly rather than via HttpRootPathBuildItem.routeBuilder()"],"exampleFix":"// before\nbuildItem.routeBuilder().routeFunction(router -> router.route(\"/x\").handler(h));\n\n// after\nbuildItem.routeBuilder().routeFunction(\"/x\", route -> route.handler(h));","handlingStrategy":"validation","validationCode":"// Only call routeFunction(Function) on objects explicitly typed as RouteBuildItem.Builder,\n// never on HttpRootPathBuildItem.routeBuilder() results.\n// Prefer: builder.routeFunction(String path, Consumer<Route> consumer)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use the String path + Consumer<Route> overload with root-path builders","Wrap common route registration into helpers taking (path, Consumer<Route>)","Keep route registration code written against plain Router separate from HttpRootPathBuildItem-based code"],"tags":["router","api-misuse","build-time"],"backgroundTag":"unsupported-builder-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"}