quarkusio/quarkus · error · RuntimeException

ClassInfo not found for ${className}

Error message

ClassInfo not found for ${className}

What it means

During bytecode transformation for class-injected fields (RESTEasy Reactive's class injector optimization), ClassInjectorTransformer.apply needs the Jandex ClassInfo for the target class to read its metadata. If the index does not contain the class, transformation cannot proceed and a RuntimeException is thrown.

Source

Thrown at independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ClassInjectorTransformer.java:99

            boolean requireCreateBeanParams, IndexView indexView) {
        this.fieldExtractors = fieldExtractors;
        this.superTypeIsInjectable = superTypeIsInjectable;
        this.requireCreateBeanParams = requireCreateBeanParams;
        this.indexView = indexView;
    }

    @Override
    public ClassVisitor apply(String className, ClassVisitor outputClassVisitor) {
        ClassTransformer transformer = new ClassTransformer(className);

        // Make the class public so we can call its static init converters from other packages
        transformer.removeModifiers(Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED);
        transformer.addModifiers(Opcodes.ACC_PUBLIC);

        // Get ClassInfo
        ClassInfo classInfo = indexView.getClassByName(className.replace('/', '.'));
        if (classInfo == null) {
            throw new RuntimeException("ClassInfo not found for " + className);
        }

        // Collect part types for multipart PartType parameters
        LinkedHashMap<FieldInfo, ServerIndexedParameter> partTypes = new LinkedHashMap<>();
        for (Entry<FieldInfo, ServerIndexedParameter> entry : fieldExtractors.entrySet()) {
            FieldInfo fieldInfo = entry.getKey();
            ServerIndexedParameter extractor = entry.getValue();
            if (extractor.getType() == ParameterType.FORM) {
                MultipartFormParamExtractor.Type multipartFormType = getMultipartFormType(extractor);
                if (multipartFormType == MultipartFormParamExtractor.Type.PartType) {
                    partTypes.put(fieldInfo, extractor);
                }
            }
        }

        // Add interface
        if (!superTypeIsInjectable) {
            transformer.addInterface(ResteasyReactiveInjectionTarget.class);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the class is part of the Jandex index — add its archive/location to indexed classes or re-run indexing after generation.
  2. If the class is generated by an earlier build step, make sure your step is ordered after it (use @BuildStep(loads=...) / BuildProducer ordering).
  3. Verify the className passed uses the internal slashed form that the transformer expects, since the code converts '/' to '.' before lookup.
  4. If writing a custom extension, index additional classes via AdditionalClassesIndexBuildItem or register them for indexing.

Example fix

// before
transformer.apply("com/example/Generated/Resource"); // not indexed
// after
// produce an AdditionalClassesIndexBuildItem or ensure the class is written before indexing
indexProducer.produceIndexFor(GeneratedResource.class);
Defensive patterns

Strategy: validation

Validate before calling

ClassInfo info = indexView.getClassByName(className.replace('/', '.'));
if (info == null) {
    throw new IllegalStateException("Class " + className + " must be part of the Jandex index before injection transformation");
}

Try / catch

try {
    transformer.apply(className);
} catch (RuntimeException e) {
    if (e.getMessage().startsWith("ClassInfo not found")) {
        throw new BuildException("Add " + className + " to the Jandex index (index the producing archive or order build steps)", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling apply() with a className whose internal (slashed) name, after conversion to a dotted name, is absent from the IndexView used at build time — i.e. a class not covered by the application index.

Common situations: Classes generated by other build steps after indexing; classes from dependencies not included in the index; a stale/partial index in custom build-step code; typos in internal vs dotted class names.

Related errors


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