{"record":{"id":"9703c32e0caf7e7d","repo":"quarkusio/quarkus","slug":"never-loaded-class-listed-multiple-times","errorCode":null,"errorMessage":"never loaded class listed multiple times: ","messagePattern":"never loaded class listed multiple times: ","errorType":"exception","errorClass":"ClassLoaderLimiterConsistencyException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassLoaderLimiter.java","lineNumber":140,"sourceCode":"         * List a fully qualified class name as one that you don't expect to be loaded ever.\n         * If there is an attempt of loading the matched class, a runtime exception will be thrown instead:\n         * useful for running integration tests to verify your assumptions.\n         * <p>\n         * DO NOT list the name by doing using <code>literal.class.getName()</code> as this will implicitly get you\n         * to load the class during the test, and produce a failure.\n         * <p>\n         * Limitations: if the class is being loaded using the bootstrap classloader we\n         * can't check it. Most Quarkus extensions and frameworks will not use the bootstrap classloader,\n         * but some code could make use of it explicitly.\n         *\n         * @param vetoedClassName the fully qualified class name\n         * @return this, for method chaining.\n         */\n        public Builder neverLoadedClassName(String vetoedClassName) {\n            Objects.requireNonNull(vetoedClassName);\n            final boolean add = vetoedClasses.add(vetoedClassName);\n            if (!add)\n                throw new ClassLoaderLimiterConsistencyException(\n                        \"never loaded class listed multiple times: \" + vetoedClassName);\n            return this;\n        }\n\n        /**\n         * List a fully qualified class name as one that you don't expect to be loaded at runtime.\n         * If there is an attempt of loading the matched class, a runtime exception will be thrown instead:\n         * useful for running integration tests to verify your assumptions.\n         * <p>\n         * DO NOT list the name by doing using <code>literal.class.getName()</code> as this will implicitly get you\n         * to load the class during the test, and produce a failure.\n         * <p>\n         * Limitations: if the class is being loaded using the bootstrap classloader we\n         * can't check it. Most Quarkus extensions and frameworks will not use the bootstrap classloader,\n         * but some code could make use of it explicitly.\n         *\n         * @param vetoedClassName the fully qualified class name\n         * @return this, for method chaining.","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassLoaderLimiter.java#L122-L158","documentation":"Thrown by ClassLoaderLimiter.Builder.neverLoadedClassName when the same fully qualified class name is added more than once to the vetoed-classes set. The limiter requires each class name to be registered exactly once so its consistency checks at runtime stay meaningful. This is a build-time configuration bug in code constructing the limiter.","triggerScenarios":"Calling builder.neverLoadedClassName(fqcn) twice with the same class name (Set.add returns false).","commonSituations":"Multiple Quarkus extensions or build steps each registering the same class as never loaded; merging limiter configs from two sources without deduplication.","solutions":["Deduplicate class names (use a LinkedHashSet) before registering them on the builder","Guard each call so a class is registered only by the component that owns it","Remove one of the duplicate registrations"],"exampleFix":"// before\nbuilder.neverLoadedClassName(\"com.foo.Bar\");\nbuilder.neverLoadedClassName(\"com.foo.Bar\"); // throws\n// after\nSet<String> seen = new LinkedHashSet<>();\nif (seen.add(\"com.foo.Bar\")) builder.neverLoadedClassName(\"com.foo.Bar\");","handlingStrategy":"validation","validationCode":"if (!seenClasses.add(fqcn)) { /* skip or fail fast */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use LinkedHashSet to deduplicate class names before registration","Assign each class a single owning registrant","Log duplicates instead of silently re-registering"],"tags":["classloading","bootstrap","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-12T22:17:10.623Z"}