{"record":{"id":"fc206390c58ad96c","repo":"quarkusio/quarkus","slug":"invalid-url","errorCode":null,"errorMessage":"Invalid URL: ","messagePattern":"Invalid URL: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/MemoryClassPathElement.java","lineNumber":95,"sourceCode":"            @Override\n            public ClassPathElement getContainingElement() {\n                return MemoryClassPathElement.this;\n            }\n\n            @Override\n            public String getPath() {\n                return name;\n            }\n\n            @Override\n            public URL getUrl() {\n                String path = \"quarkus:\" + name;\n                try {\n                    URL url = new URL(null, path, new MemoryUrlStreamHandler(resources.get(name), lastModified));\n\n                    return url;\n                } catch (MalformedURLException e) {\n                    throw new IllegalArgumentException(\"Invalid URL: \" + path);\n                }\n            }\n\n            @Override\n            public byte[] getData() {\n                return res;\n            }\n\n            @Override\n            public boolean isDirectory() {\n                return false;\n            }\n        };\n    }\n\n    @Override\n    public Set<String> getProvidedResources() {\n        return resources.keySet();","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/MemoryClassPathElement.java#L77-L113","documentation":"Thrown from MemoryClassPathElement.getUrl when constructing the quarkus: memory URL for an in-memory resource fails with MalformedURLException, and rethrown as IllegalArgumentException. The quarkus: protocol relies on MemoryUrlStreamHandler being registered; URL construction should normally succeed. Receiving this means the URL factory infrastructure was unavailable or the path was malformed.","triggerScenarios":"Calling getUrl() on a MemoryClassPathElement when new URL(null, \"quarkus:\"+name, handler) throws MalformedURLException — typically because the MemoryURLStreamHandlerFactory was never installed on the URL stream handler factory.","commonSituations":"Tests or embedded usage that create MemoryClassPathElement instances without registering the memory URL stream handler factory; name containing characters that break URL parsing.","solutions":["Ensure MemoryURLStreamHandlerFactory is installed (URL.setURLStreamHandlerFactory) before creating memory class path elements","Check the resource name for invalid URL characters","Run within standard Quarkus bootstrap which installs the factory automatically"],"exampleFix":"// before\nURL.setURLStreamHandlerFactory(new TomcatURLStreamHandlerFactory()); // displaces quarkus handler\n// after\nURL.setURLStreamHandlerFactory(new MemoryURLStreamHandlerFactory()); // or composite factory including it","handlingStrategy":"try-catch","validationCode":"try {\n    new URL(null, \"quarkus:\" + name, new MemoryUrlStreamHandler(bytes, lastModified));\n} catch (MalformedURLException e) { /* handler factory missing or bad name */ }","typeGuard":"boolean isMemoryUrlSupported(String name) {\n    return URL.getURLStreamHandler(\"quarkus\") != null\n        && name.chars().allMatch(c -> c > 32 && c < 127);\n}","tryCatchPattern":"try {\n    URL url = element.getUrl();\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"Memory URL support unavailable; install MemoryURLStreamHandlerFactory\", e);\n}","preventionTips":["Install MemoryURLStreamHandlerFactory before any memory classpath element is used","Avoid custom URL.setURLStreamHandlerFactory calls that displace the quarkus handler","Keep resource names URL-safe"],"tags":["classloading","url","bootstrap"],"backgroundTag":"malformed-url","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"}