{"record":{"id":"8b0d4b0720fa2c0f","repo":"quarkusio/quarkus","slug":"no-url-specified-cannot-build-a-rest-client-witho","errorCode":null,"errorMessage":"No URL specified. Cannot build a rest client without URL","messagePattern":"No URL specified\\. Cannot build a rest client without URL","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/RestClientBuilderImpl.java","lineNumber":518,"sourceCode":"        ArcContainer arcContainer = Arc.container();\n        if (arcContainer == null) {\n            throw new IllegalStateException(\n                    \"The Reactive REST Client needs to be built within the context of a Quarkus application with a valid ArC (CDI) context running.\");\n        }\n\n        SmallRyeConfig config = ConfigProvider.getConfig().unwrap(SmallRyeConfig.class);\n        RestClientsConfig restClients = config.getConfigMapping(RestClientsConfig.class);\n\n        // support overriding the URI from the override-uri property\n        var overrideUrlKeyName = String.format(\"quarkus.rest-client.\\\"%s\\\".override-uri\", aClass.getName());\n        Optional<String> maybeOverrideUri = config.getOptionalValue(overrideUrlKeyName, String.class);\n        if (maybeOverrideUri.isPresent()) {\n            uri = URI.create(maybeOverrideUri.get());\n        }\n\n        if (uri == null) {\n            // mandated by the spec\n            throw new IllegalStateException(\"No URL specified. Cannot build a rest client without URL\");\n        }\n\n        RestClientListeners.get().forEach(listener -> listener.onNewClient(aClass, this));\n\n        AnnotationRegisteredProviders annotationRegisteredProviders = arcContainer\n                .instance(AnnotationRegisteredProviders.class).get();\n        for (Map.Entry<Class<?>, Integer> mapper : annotationRegisteredProviders.getProviders(aClass).entrySet()) {\n            register(mapper.getKey(), mapper.getValue());\n        }\n\n        exceptionMappers.sort(Comparator.comparingInt(ResponseExceptionMapper::getPriority));\n        redirectHandlers.sort(Comparator.comparingInt(RedirectHandler::getPriority));\n        clientBuilder.register(new MicroProfileRestClientResponseFilter(exceptionMappers));\n        clientBuilder.followRedirects(followRedirects != null ? followRedirects : restClients.followRedirects().orElse(false));\n\n        RestClientsConfig.RestClientLoggingConfig configRootLogging = restClients.logging();\n\n        LoggingScope effectiveLoggingScope = LoggingScope.NONE;","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/RestClientBuilderImpl.java#L500-L536","documentation":"The MP REST Client spec requires a base URI/URL before a client can be built. After applying all overrides (property overrides like quarkus.rest-client.<key>.url and the builder's baseUri/baseUrl), if no URI is present, build throws this IllegalStateException. It is the spec-mandated behavior for a missing endpoint.","triggerScenarios":"Building a client with no builder.baseUri(...)/baseUrl(...) call and no quarkus.rest-client.<config-key>.url property (nor the legacy MP property) configured.","commonSituations":"Missing @RegisterRestClient config in application.properties; config key mismatch between the interface's configKey and the property name; typos like 'uri' vs 'url'; profile-specific config not active in the test environment.","solutions":["Set the URL in application.properties: quarkus.rest-client.<config-key>.url=http://host:port (or mp.rest-client... for MP config).","Call builder.baseUri(URI.create(...)) / baseUrl(...) explicitly when building programmatically.","Verify the config key matches the interface name or its @RegisterRestClient(configKey=...) value.","Check that the property is not disabled by the active Quarkus profile."],"exampleFix":"// before\nMyClient c = QuarkusRestClientBuilder.newBuilder().build(MyClient.class); // IllegalStateException\n\n// after\nMyClient c = QuarkusRestClientBuilder.newBuilder()\n        .baseUri(URI.create(\"http://localhost:8080\"))\n        .build(MyClient.class);\n// or in application.properties: quarkus.rest-client.my-client.url=http://localhost:8080","handlingStrategy":"validation","validationCode":"URI uri = ...resolve from config...;\nif (uri == null || uri.toString().isBlank()) {\n    throw new IllegalStateException(\"Set quarkus.rest-client.<key>.url before building the client\");\n}\nbuilder.baseUri(uri).build(MyClient.class);","typeGuard":"null","tryCatchPattern":"try {\n    T client = builder.build(MyClient.class);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"No URL specified\")) {\n        builder.baseUri(URI.create(defaultUrl)).build(MyClient.class);\n    } else throw e;\n}","preventionTips":["Always set quarkus.rest-client.<config-key>.url for every @RegisterRestClient interface.","Match the config key with the interface name or @RegisterRestClient(configKey=...).","Check profile-specific properties when running tests against non-prod profiles."],"tags":["rest-client","configuration","quarkus","missing-config"],"backgroundTag":"missing-base-url","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}