quarkusio/quarkus · error · ClassLoaderLimiterConsistencyException

never loaded class listed multiple times:

Error message

never loaded class listed multiple times: 

What it means

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.

Source

Thrown at independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassLoaderLimiter.java:140

         * List a fully qualified class name as one that you don't expect to be loaded ever.
         * If there is an attempt of loading the matched class, a runtime exception will be thrown instead:
         * useful for running integration tests to verify your assumptions.
         * <p>
         * DO NOT list the name by doing using <code>literal.class.getName()</code> as this will implicitly get you
         * to load the class during the test, and produce a failure.
         * <p>
         * Limitations: if the class is being loaded using the bootstrap classloader we
         * can't check it. Most Quarkus extensions and frameworks will not use the bootstrap classloader,
         * but some code could make use of it explicitly.
         *
         * @param vetoedClassName the fully qualified class name
         * @return this, for method chaining.
         */
        public Builder neverLoadedClassName(String vetoedClassName) {
            Objects.requireNonNull(vetoedClassName);
            final boolean add = vetoedClasses.add(vetoedClassName);
            if (!add)
                throw new ClassLoaderLimiterConsistencyException(
                        "never loaded class listed multiple times: " + vetoedClassName);
            return this;
        }

        /**
         * List a fully qualified class name as one that you don't expect to be loaded at runtime.
         * If there is an attempt of loading the matched class, a runtime exception will be thrown instead:
         * useful for running integration tests to verify your assumptions.
         * <p>
         * DO NOT list the name by doing using <code>literal.class.getName()</code> as this will implicitly get you
         * to load the class during the test, and produce a failure.
         * <p>
         * Limitations: if the class is being loaded using the bootstrap classloader we
         * can't check it. Most Quarkus extensions and frameworks will not use the bootstrap classloader,
         * but some code could make use of it explicitly.
         *
         * @param vetoedClassName the fully qualified class name
         * @return this, for method chaining.

View on GitHub (pinned to e1c734241f)

Solutions

  1. Deduplicate class names (use a LinkedHashSet) before registering them on the builder
  2. Guard each call so a class is registered only by the component that owns it
  3. Remove one of the duplicate registrations

Example fix

// before
builder.neverLoadedClassName("com.foo.Bar");
builder.neverLoadedClassName("com.foo.Bar"); // throws
// after
Set<String> seen = new LinkedHashSet<>();
if (seen.add("com.foo.Bar")) builder.neverLoadedClassName("com.foo.Bar");
Defensive patterns

Strategy: validation

Validate before calling

if (!seenClasses.add(fqcn)) { /* skip or fail fast */ }

Prevention

When it happens

Trigger: Calling builder.neverLoadedClassName(fqcn) twice with the same class name (Set.add returns false).

Common situations: Multiple Quarkus extensions or build steps each registering the same class as never loaded; merging limiter configs from two sources without deduplication.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/9703c32e0caf7e7d. Report an issue: GitHub.