quarkusio/quarkus · error · UncheckedIOException

${className} class reading failed

Error message

${className} class reading failed

What it means

Before deciding whether a filter class should be skipped during method collection, Quarkus reads the filter class bytecode via classLoader.getResourceAsStream and parses it with ASM. If the class resource cannot be read (IOException, typically because the class is not visible to the deployment classloader or the stream is null/invalid), deployment fails with this UncheckedIOException wrapping the cause.

Source

Thrown at extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/FilterClassIntrospector.java:36

public class FilterClassIntrospector {

    private final ClassLoader classLoader;

    public FilterClassIntrospector(ClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    public boolean usesGetResourceMethod(MethodInfo methodInfo) {
        String className = methodInfo.declaringClass().name().toString();
        final String resourceName = fromClassNameToResourceName(className);
        try (InputStream is = classLoader.getResourceAsStream(resourceName)) {
            ClassReader configClassReader = new ClassReader(is);
            FilterClassVisitor classVisitor = new FilterClassVisitor(methodInfo.descriptor());
            configClassReader.accept(classVisitor, 0);
            return classVisitor.usesGetResourceMethod();
        } catch (IOException e) {
            throw new UncheckedIOException(className + " class reading failed", e);
        }
    }

    private static class FilterClassVisitor extends ClassVisitor {

        private final String methodDescriptor;
        private final UsesGetResourceMethodVisitor methodVisitor = new UsesGetResourceMethodVisitor();

        private FilterClassVisitor(String methodDescriptor) {
            super(Gizmo.ASM_API_VERSION);
            this.methodDescriptor = methodDescriptor;
        }

        @Override
        public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
            MethodVisitor superMethodVisitor = super.visitMethod(access, name, descriptor, signature, exceptions);
            if (methodDescriptor.equals(descriptor)) {
                return methodVisitor;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Inspect the wrapped cause (getCause()) to identify the actual IO failure and the offending class file location
  2. Check for duplicate/corrupt jars containing the filter class on the application classpath
  3. Clean the build (mvn clean) and rebuild to eliminate stale generated classes
  4. Ensure the filter class is compiled as a normal application class visible to Quarkus (not generated or loaded dynamically)
Defensive patterns

Strategy: validation

Validate before calling

// confirm the filter class bytes are readable from the app classloader before building
String resourceName = filterClass.getName().replace('.', '/') + ".class";
if (filterClass.getClassLoader().getResource(resourceName) == null)
    throw new IllegalStateException("Filter class bytes not found: " + filterClass);
try (InputStream is = filterClass.getClassLoader().getResourceAsStream(resourceName)) {
    if (is == null || is.read() == -1) throw new IllegalStateException("Unreadable class resource: " + resourceName);
}

Try / catch

try {
    // build / deployment step that loads filters
} catch (UncheckedIOException e) {
    logger.error("Class reading failed for " + e.getMessage() + ", cause: " + e.getCause(), e);
    throw e; // fail fast after diagnosis
}

Prevention

When it happens

Trigger: A ContainerRequestFilter/ContainerResponseFilter (or similar) class registered in the application cannot be read from the current classloader during the RESTEasy Reactive build — e.g. the resource name resolves but the stream fails, or a filter class comes from a jar/classloader whose bytes are unavailable at build time.

Common situations: Filters provided by shaded/duplicated jars, corrupted class files, filters generated by other build steps but not yet written, or classloader visibility issues with exotic packaging (fat jars, custom runners).

Related errors


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