{"record":{"id":"59d0d83ac2b903eb","repo":"quarkusio/quarkus","slug":"cannot-find-classloadingrecorder-class-on-classpat","errorCode":null,"errorMessage":"Cannot find ClassLoadingRecorder.class on classpath","messagePattern":"Cannot find ClassLoadingRecorder\\.class on classpath","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/ForkedJvmEnvironment.java","lineNumber":181,"sourceCode":"            }\n            String classFile = entry.getKey().replace('.', '/') + \".class\";\n            Path target = dir.resolve(classFile);\n            Files.createDirectories(target.getParent());\n            Files.write(target, bytes);\n        }\n    }\n\n    /**\n     * Writes the {@link ClassLoadingRecorder} class files to the temp directory.\n     */\n    private static void writeRecorderClass(Path tempDir) throws IOException {\n        String baseName = ClassLoadingRecorder.class.getName().replace('.', '/');\n        for (String suffix : new String[] { \".class\", \"$RecordingClassLoader.class\" }) {\n            String resourcePath = baseName + suffix;\n            try (var is = ForkedJvmEnvironment.class.getClassLoader().getResourceAsStream(resourcePath)) {\n                if (is == null) {\n                    if (suffix.equals(\".class\")) {\n                        throw new IOException(\"Cannot find ClassLoadingRecorder.class on classpath\");\n                    }\n                    continue;\n                }\n                Path target = tempDir.resolve(resourcePath);\n                Files.createDirectories(target.getParent());\n                Files.write(target, is.readAllBytes());\n            }\n        }\n    }\n}\n","sourceCodeStart":163,"sourceCodeEnd":192,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/ForkedJvmEnvironment.java#L163-L192","documentation":"ForkedJvmEnvironment.writeRecorderClass copies ClassLoadingRecorder.class (and its nested $RecordingClassLoader.class) from the deployment classloader into the temp dir used to boot a forked JVM. If the base .class resource cannot be found on the classpath, this IOException is thrown, meaning the forked environment cannot be set up.","triggerScenarios":"create() prepares a forked JVM (e.g. for CDS/AppCDS or JVM startup optimization) and ClassLoadingRecorder.class is missing from the classloader's resources — typically the deployment classes are not packaged in the expected location, or a shading/relocation/shrink step removed it.","commonSituations":"Running Quarkus built from an unusual/unofficial distribution; custom classloading setups (security managers, isolated classloaders, Gradle/Maven classpath filtering); relocation/shading plugins stripping io.quarkus.deployment resources; truncated or partially extracted quarkus-deployment jar.","solutions":["Rebuild with a clean local repository: mvn clean and remove ~/.m2 stale quarkus artifacts.","Verify quarkus-deployment jar is intact and contains io/quarkus/deployment/pkg/steps/ClassLoadingRecorder.class (jar tf).","Disable custom shading/relocation/proguard plugins that strip quarkus-deployment resources.","Check for custom classloader configuration (e.g. security policies or classpath filters) blocking getResourceAsStream.","Reproduce with the standard build (plain mvn package) to rule out environment-specific classloading."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"String res = \"io/quarkus/deployment/pkg/steps/ClassLoadingRecorder.class\";\nif (Thread.currentThread().getContextClassLoader().getResource(res) == null\n        && ForkedJvmEnvironment.class.getClassLoader().getResource(res) == null) {\n    throw new IllegalStateException(\"quarkus-deployment jar missing/corrupt: \" + res\n            + \" — run 'mvn clean' and re-download dependencies\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify quarkus-deployment jar integrity: jar tf | grep ClassLoadingRecorder.","Avoid shading/relocating or filtering Quarkus deployment classes.","Use official Quarkus distributions and a clean ~/.m2 when classpath errors appear.","Beware custom classloader setups that block getResourceAsStream."],"tags":["classloading","forked-jvm","deployment"],"backgroundTag":"class-not-found-on-classpath","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"}