{"record":{"id":"46140e658a6a8dcc","repo":"quarkusio/quarkus","slug":"neither-baseuri-nor-baseurl-was-specified","errorCode":null,"errorMessage":"Neither baseUri nor baseUrl was specified","messagePattern":"Neither baseUri nor baseUrl was specified","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/QuarkusRestClientBuilder.java","lineNumber":261,"sourceCode":"    @Override\n    public RestClientBuilder executorService(ExecutorService executor) {\n        if (executor == null) {\n            throw new IllegalArgumentException(\"ExecutorService must not be null\");\n        }\n        executorService = ContextualExecutors.wrap(executor);\n        return this;\n    }\n\n    public <T> T build(Class<T> aClass, ClientHttpEngine httpEngine)\n            throws IllegalStateException, RestClientDefinitionException {\n\n        RestClientListeners.get().forEach(listener -> listener.onNewClient(aClass, this));\n\n        // Interface validity\n        verifyInterface(aClass);\n\n        if (baseURI == null) {\n            throw new IllegalStateException(\"Neither baseUri nor baseUrl was specified\");\n        }\n\n        // Provider annotations\n        RegisterProvider[] providers = aClass.getAnnotationsByType(RegisterProvider.class);\n\n        for (RegisterProvider provider : providers) {\n            register(provider.value(), provider.priority());\n        }\n\n        // Default exception mapper\n        if (!isMapperDisabled()) {\n            register(DefaultResponseExceptionMapper.class);\n        }\n\n        builderDelegate.register(new ExceptionMapping(localProviderInstances), 1);\n\n        ClassLoader classLoader = aClass.getClassLoader();\n","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/QuarkusRestClientBuilder.java#L243-L279","documentation":"Thrown by QuarkusRestClientBuilder.build when neither baseUri nor baseUrl was set on the builder. A REST client cannot make requests without a target base URI, so build fails fast with IllegalStateException.","triggerScenarios":"Calling build(Class) without calling baseUri(...) or baseUrl(...) first; config property quarkus.rest-client.<key>.url missing; baseUri set conditionally and the condition never hit.","commonSituations":"Forgetting quarkus.rest-client.<config-key>.url in application.properties; profile-specific config (e.g. %prod) missing the URL; constructing the builder manually in tests and skipping baseUri; key name mismatch between @RegisterRestClient(configKey=...) and the property prefix.","solutions":["Call builder.baseUri(URI.create(\"https://host\")) or baseUrl(URL) before build()","Set quarkus.rest-client.<config-key>.url (or quarkus.rest-client.<fqcn>.url) in application.properties","Check that the active config profile actually defines the URL property","Verify the @RegisterRestClient configKey matches the property prefix exactly"],"exampleFix":"// before\nMyClient c = RestClientBuilder.newBuilder().build(MyClient.class); // IllegalStateException\n// after\nMyClient c = RestClientBuilder.newBuilder()\n        .baseUri(URI.create(\"https://api.example.com\"))\n        .build(MyClient.class);","handlingStrategy":"validation","validationCode":"if (baseUri == null && baseUrl == null) {\n    throw new IllegalStateException(\"Set quarkus.rest-client.<key>.url or call baseUri()/baseUrl() before build()\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    client = builder.build(MyClient.class);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"Neither baseUri nor baseUrl was specified\")) {\n        throw new ConfigurationException(\"Missing quarkus.rest-client.<key>.url\", e);\n    }\n    throw e;\n}","preventionTips":["Always set quarkus.rest-client.<config-key>.url for every @RegisterRestClient interface","Keep the configKey in @RegisterRestClient matching the property prefix","Check all config profiles (%prod, %test) define the URL","Add a startup smoke test that builds each client"],"tags":["rest-client","configuration","missing-url","illegal-state"],"backgroundTag":"missing-config-property","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"}