{"record":{"id":"3fc08d8052f89dba","repo":"quarkusio/quarkus","slug":"resource-listed-multiple-times-to-produce-a-stackt","errorCode":null,"errorMessage":"resource listed multiple times to produce a stacktrace: ","messagePattern":"resource listed multiple times to produce a stacktrace: ","errorType":"exception","errorClass":"ClassLoaderLimiterConsistencyException","httpStatus":null,"severity":"warning","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassLoaderLimiter.java","lineNumber":209,"sourceCode":"                throw new ClassLoaderLimiterConsistencyException(\n                        resourceFullName + \" is being listed both as never loaded and as at most once\");\n            }\n            return this;\n        }\n\n        /**\n         * When the specified resource is loaded, print a full stack trace on System out.\n         * This is not useful for testing, but handy to trace were a certain load is coming from,\n         * should you need to diagnose a failing expectation.\n         *\n         * @param resourceFullName\n         * @return this, for method chaining.\n         */\n        public Builder produceStackTraceOnLoad(String resourceFullName) {\n            Objects.requireNonNull(resourceFullName);\n            final boolean add = onHitPrintStacktrace.add(resourceFullName);\n            if (!add)\n                throw new ClassLoaderLimiterConsistencyException(\n                        \"resource listed multiple times to produce a stacktrace: \" + resourceFullName);\n            return this;\n        }\n\n        /**\n         * Simply log all resource loading events. Useful to get an idea of which resources are being loaded;\n         * Note it includes resources being used to load classes.\n         *\n         * @param enable\n         * @return this, for method chaining.\n         */\n        public Builder traceAllResourceLoad(boolean enable) {\n            traceAllResourceLoad = enable;\n            return this;\n        }\n\n        public ClassLoaderLimiter build() {\n            return new ClassLoaderLimiter(this);","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassLoaderLimiter.java#L191-L227","documentation":"Thrown by ClassLoaderLimiter.Builder.produceStackTraceOnLoad when the same resource is registered more than once for stacktrace-on-load debugging. Each registered resource should appear once so the limiter's debug sets stay consistent. This only affects debug/diagnostic configuration of the class loader.","triggerScenarios":"Calling builder.produceStackTraceOnLoad(name) twice for the same resourceFullName (Set.add returns false).","commonSituations":"Debugging classloading leaks where multiple diagnostic registrations of the same resource accumulate, e.g. from repeated builder configuration.","solutions":["Deduplicate resource names before registering them for stacktrace logging","Remove the duplicate produceStackTraceOnLoad call","Guard the call with a Set to make registration idempotent"],"exampleFix":"// before\nbuilder.produceStackTraceOnLoad(\"quarkus-run.jar\");\nbuilder.produceStackTraceOnLoad(\"quarkus-run.jar\"); // throws\n// after\nif (debugSeen.add(\"quarkus-run.jar\")) builder.produceStackTraceOnLoad(\"quarkus-run.jar\");","handlingStrategy":"validation","validationCode":"if (!debugResources.add(name)) { /* skip duplicate */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Guard debug registration with a Set","Only register stacktrace-on-load from a single diagnostics config point","Remove debug registrations once diagnosis is done"],"tags":["classloading","debugging","builder-validation"],"backgroundTag":"duplicate-registration","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"}