quarkusio/quarkus · error · UncheckedIOException
class reading failed
Error message
class reading failed
What it means
removePropertiesWithCandidateAnalysis loads a compiled @ConfigurationProperties class as a resource from the application index and parses it with ASM's ClassReader. If the class resource cannot be read (null stream or I/O failure), the IOException is wrapped in an UncheckedIOException with '<class> class reading failed', aborting the build.
Source
Thrown at extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ConfigPropertyBuildItemCandidateUtil.java:36
public class ConfigPropertyBuildItemCandidateUtil {
private static final Logger LOGGER = Logger.getLogger(ConfigPropertyBuildItemCandidateUtil.class);
/**
* This method inspects the {@code configClass} bytecode to identify all fields that have a default value set in the class
* constructor. These fields are removed from the {@link ConfigPropertyBuildItemCandidate} list because we don't want to
* throw an exception if no config property value was provided for them. There is no bytecode modification performed during
* this process.
*/
public static void removePropertiesWithDefaultValue(ClassLoader classLoader, String configClass,
List<ConfigPropertyBuildItemCandidate> candidates) {
final String resourceName = fromClassNameToResourceName(configClass);
try (InputStream is = classLoader.getResourceAsStream(resourceName)) {
ClassReader configClassReader = new ClassReader(is);
configClassReader.accept(new ConfigClassVisitor(candidates, configClass), 0);
} catch (IOException e) {
throw new UncheckedIOException(configClass + " class reading failed", e);
}
}
private static class ConfigClassVisitor extends ClassVisitor {
private final List<ConfigPropertyBuildItemCandidate> candidates;
private final String configClass;
private ConfigClassVisitor(List<ConfigPropertyBuildItemCandidate> candidates, String configClass) {
super(Gizmo.ASM_API_VERSION);
this.candidates = candidates;
this.configClass = configClass;
}
@Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
MethodVisitor superMethodVisitor = super.visitMethod(access, name, descriptor, signature, exceptions);
if (name.equals("<init>") && descriptor.equals("()V")) {View on GitHub (pinned to e1c734241f)
Solutions
- Run a clean build (./mvnw clean install) to restore the missing or stale class file in the target output.
- Verify the @ConfigurationProperties class exists at the FQCN the annotation references and is compiled into the module on the classpath.
- Check build/packaging excludes or shade/relocation config that might strip the .class resource.
- Inspect the cause chain of the UncheckedIOException for the underlying IOException details.
Defensive patterns
Strategy: retry
Try / catch
// build script: clean rebuild on this failure
try {
./mvnw install -f extensions/spring-boot-properties/
} catch (UncheckedIOException e) if (e.message.endsWith("class reading failed")) {
./mvnw clean install // rebuild to regenerate the missing/corrupt class resource
} Prevention
- Run clean builds after refactoring config class packages/names
- Ensure config classes are plain compiled classes on the application classpath
- Check packaging/shade excludes that could strip .class resources
When it happens
Trigger: The config class name passed to removePropertiesWithDefaultValue cannot be resolved to a class-file resource by the given ClassLoader (getResourceAsStream returns null, making ClassReader throw a null-stream IOException), or the class file is unreadable/corrupt — raised while filtering config property build item candidates.
Common situations: The class is generated or transformed so its .class resource isn't on the deployment-time classpath; a stale incremental build where the class file was deleted; packaging that excludes class resources; class-name/package mismatch after refactoring.
Related errors
- Failed to open path tree with root %s
- The class (${className}) cannot be found during deployment.
- ${className} class reading failed
- Failed to load CodeGenProvider class from deployment classlo
- Failed to read %s
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/52026a89a8e82d5c.
Report an issue: GitHub.