{"record":{"id":"3d65ecf5a1c3ec6f","repo":"quarkusio/quarkus","slug":"unable-to-create-protection-domain-for","errorCode":null,"errorMessage":"Unable to create protection domain for ","messagePattern":"Unable to create protection domain for ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/PathTreeClassPathElement.java","lineNumber":176,"sourceCode":"\n    @Override\n    public boolean containsReloadableResources() {\n        return !pathTree.isArchiveOrigin();\n    }\n\n    @Override\n    public ManifestAttributes getManifestAttributes() {\n        return apply(OpenPathTree::getManifestAttributes);\n    }\n\n    @Override\n    public ProtectionDomain getProtectionDomain() {\n        URL url = null;\n        final Path root = getRoot();\n        try {\n            url = root.toUri().toURL();\n        } catch (MalformedURLException e) {\n            throw new RuntimeException(\"Unable to create protection domain for \" + root, e);\n        }\n        CodeSource codesource = new CodeSource(url, (Certificate[]) null);\n        return new ProtectionDomain(codesource, null);\n    }\n\n    @Override\n    public void close() throws IOException {\n        lock.writeLock().lock();\n        try {\n            pathTree.close();\n        } finally {\n            lock.writeLock().unlock();\n        }\n    }\n\n    @Override\n    public String toString() {\n        final StringBuilder sb = new StringBuilder();","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/PathTreeClassPathElement.java#L158-L194","documentation":"Thrown from PathTreeClassPathElement.getProtectionDomain when converting the element's root Path to a URL fails with MalformedURLException, wrapped in a RuntimeException. Protection domains need a CodeSource URL; if the path cannot be expressed as a valid URL the domain cannot be built. This indicates an unrepresentable/invalid root path.","triggerScenarios":"Calling getProtectionDomain() on an element whose root Path produces a URI that URL cannot parse (unsupported/invalid URI scheme characters in the path).","commonSituations":"Paths with illegal characters (spaces or special characters on some platforms/JDKs) in the directory or jar location of the application.","solutions":["Move/rename the application or its jars to a path without special characters","Inspect the cause MalformedURLException to see which part of the path is invalid","Quote/encode the path before launching the application"],"exampleFix":"// before\njava -jar /path with spaces/app-runner.jar // may yield unparseable URI\n// after\njava -jar \"/path%20with%20spaces/app-runner.jar\" // or avoid spaces entirely","handlingStrategy":"validation","validationCode":"try {\n    new URL(root.toUri().toString());\n} catch (MalformedURLException e) { /* path unrepresentable: relocate app */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Launch the app from paths without spaces or special characters","Verify the root path converts to a valid URI before running","Avoid unusual mount points or encoded characters in install locations"],"tags":["classloading","url","filesystem"],"backgroundTag":"malformed-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"}