quarkusio/quarkus · warning · ClassLoaderLimiterConsistencyException
resource listed multiple times to produce a stacktrace:
Error message
resource listed multiple times to produce a stacktrace:
What it means
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.
Source
Thrown at independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassLoaderLimiter.java:209
throw new ClassLoaderLimiterConsistencyException(
resourceFullName + " is being listed both as never loaded and as at most once");
}
return this;
}
/**
* When the specified resource is loaded, print a full stack trace on System out.
* This is not useful for testing, but handy to trace were a certain load is coming from,
* should you need to diagnose a failing expectation.
*
* @param resourceFullName
* @return this, for method chaining.
*/
public Builder produceStackTraceOnLoad(String resourceFullName) {
Objects.requireNonNull(resourceFullName);
final boolean add = onHitPrintStacktrace.add(resourceFullName);
if (!add)
throw new ClassLoaderLimiterConsistencyException(
"resource listed multiple times to produce a stacktrace: " + resourceFullName);
return this;
}
/**
* Simply log all resource loading events. Useful to get an idea of which resources are being loaded;
* Note it includes resources being used to load classes.
*
* @param enable
* @return this, for method chaining.
*/
public Builder traceAllResourceLoad(boolean enable) {
traceAllResourceLoad = enable;
return this;
}
public ClassLoaderLimiter build() {
return new ClassLoaderLimiter(this);View on GitHub (pinned to e1c734241f)
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
Example fix
// before
builder.produceStackTraceOnLoad("quarkus-run.jar");
builder.produceStackTraceOnLoad("quarkus-run.jar"); // throws
// after
if (debugSeen.add("quarkus-run.jar")) builder.produceStackTraceOnLoad("quarkus-run.jar"); Defensive patterns
Strategy: validation
Validate before calling
if (!debugResources.add(name)) { /* skip duplicate */ } Prevention
- Guard debug registration with a Set
- Only register stacktrace-on-load from a single diagnostics config point
- Remove debug registrations once diagnosis is done
When it happens
Trigger: Calling builder.produceStackTraceOnLoad(name) twice for the same resourceFullName (Set.add returns false).
Common situations: Debugging classloading leaks where multiple diagnostic registrations of the same resource accumulate, e.g. from repeated builder configuration.
Related errors
- is being listed both as never loaded and as at most once
- never loaded class listed multiple times:
- resource listed multiple times as loaded at most once:
- Failed to load steps from %s
- The class (${name}) cannot be created during deployment.
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/3fc08d8052f89dba.
Report an issue: GitHub.