{"record":{"id":"765649b11bb6235e","repo":"quarkusio/quarkus","slug":"s-is-not-a-valid-scheme-in-the-base-uri-s","errorCode":null,"errorMessage":"[%s] is not a valid scheme in the base URI %s","messagePattern":"\\[(.+?)\\] is not a valid scheme in the base URI (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectorBase.java","lineNumber":97,"sourceCode":"            TlsConfigurationRegistry tlsConfigurationRegistry) {\n        this.headers = new HashMap<>();\n        this.subprotocols = new HashSet<>();\n        this.pathParams = new HashMap<>();\n        this.vertx = vertx;\n        this.codecs = codecs;\n        this.connectionManager = connectionManager;\n        this.config = config;\n        this.tlsConfigurationRegistry = tlsConfigurationRegistry;\n        this.path = \"\";\n        this.pathParamNames = Set.of();\n        this.userData = new HashMap<>();\n        this.customWebSocketConnectOptions = null;\n        this.customWebSocketClientOptions = null;\n    }\n\n    public THIS baseUri(URI baseUri) {\n        if (!isSecure(baseUri) && !isNotSecure(baseUri)) {\n            throw new IllegalArgumentException(\n                    String.format(\"[%s] is not a valid scheme in the base URI %s\", baseUri.getScheme(), baseUri));\n        }\n        this.baseUri = Objects.requireNonNull(baseUri);\n        return self();\n    }\n\n    public THIS tlsConfigurationName(String tlsConfigurationName) {\n        this.tlsConfigurationName = Objects.requireNonNull(tlsConfigurationName);\n        return self();\n    }\n\n    public THIS addHeader(String name, String value) {\n        Objects.requireNonNull(name);\n        Objects.requireNonNull(value);\n        List<String> values = headers.get(name);\n        if (values == null) {\n            values = new ArrayList<>();\n            headers.put(name, values);","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectorBase.java#L79-L115","documentation":"WebSocketConnectorBase.baseUri(URI) validates that the base URI scheme is either ws/wss style secure (isSecure) or http/https style not-secure (isNotSecure). Any other scheme (e.g. ftp:, tcp:, or a malformed URI whose scheme is null) is rejected with this IllegalArgumentException so an invalid WebSocket endpoint URI never reaches the connection attempt.","triggerScenarios":"Calling WebSocketConnector.baseUri(URI) with a URI whose scheme is not ws/wss/http/https — e.g. new URI(\"myserver.example.com/ws\") parsed with no scheme, or a typo like wss:/host.","commonSituations":"Building the URI from a config property where the user omitted the scheme; concatenating host and path without the ws:// prefix; typos in configuration values.","solutions":["Prefix the URI with a valid scheme: ws://, wss://, http:// or https://","Check the config property feeding baseUri() includes an explicit scheme","Use URI.create(\"ws://\" + host + path) when the host alone is provided"],"exampleFix":"// before\nconnector.baseUri(URI.create(\"myhost.example.com/ws\"));\n// after\nconnector.baseUri(URI.create(\"ws://myhost.example.com/ws\"));","handlingStrategy":"validation","validationCode":"static void validateBaseUri(URI uri) {\n    String s = uri.getScheme();\n    if (s == null || !(s.equals(\"ws\") || s.equals(\"wss\") || s.equals(\"http\") || s.equals(\"https\"))) {\n        throw new IllegalArgumentException(\"Invalid scheme: \" + s);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    connector.baseUri(uri);\n} catch (IllegalArgumentException e) {\n    log.error(\"Fix the scheme in baseUri; must be ws/wss/http/https\", e);\n}","preventionTips":["Always include an explicit ws:// or wss:// scheme in URIs","Validate config-driven URIs at startup","Use URI.create() so malformed URIs fail early","Add a startup check that logs the resolved endpoint URI"],"tags":["websockets","uri","validation","client"],"backgroundTag":"invalid-uri-scheme","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"}