quarkusio/quarkus · error · BuildException

The class is not inside the Jandex index

Error message

The class  is not inside the Jandex index

What it means

isSubclassOf climbs the superclass chain using the Jandex index; when the parent class of the inspected class cannot be found in the IndexView it throws a BuildException saying the class is not indexed. Quarkus requires every class touched during augmentation (or at least its hierarchy) to be part of the computed Jandex index, otherwise subclass checks cannot be completed.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/util/JandexUtil.java:347

     * @param info the ClassInfo we want to check.
     * @param parentName the name of the superclass we want to find.
     * @return true if the given ClassInfo has <tt>parentName</tt> as a superclass.
     * @throws BuildException if one of the superclasses is not indexed.
     */
    public static boolean isSubclassOf(IndexView index, ClassInfo info, DotName parentName) throws BuildException {
        if (info.superName().equals(DOTNAME_OBJECT) || info.superName().equals(DOTNAME_RECORD)) {
            return false;
        }
        if (info.superName().equals(parentName)) {
            return true;
        }

        // climb up the hierarchy of classes
        Type superType = info.superClassType();
        ClassInfo superClass = index.getClassByName(superType.name());
        if (superClass == null) {
            // this can happens if the parent is not inside the Jandex index
            throw new BuildException("The class " + superType.name() + " is not inside the Jandex index",
                    Collections.emptyList());
        }
        return isSubclassOf(index, superClass, parentName);
    }

    private static class ClassNotIndexedException extends RuntimeException {

        private final DotName dotName;

        public ClassNotIndexedException(DotName dotName) {
            super("'" + dotName.toString() + "' is not indexed");
            this.dotName = dotName;
        }
    }

}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the parent class is part of the Jandex index: configure the Jandex index to include the jar/module containing it (quarkus.index-dependency in application.properties).
  2. If extending a JDK/framework class not meant to be indexed, restructure so the subclass check is not needed or the parent is an indexed application class.
  3. For generated code, register generated sources with the Jandex processor so the hierarchy is indexed.
  4. Use quarkus.index-dependency.<name>.group-id/artifact-id in application.properties for third-party dependencies that need indexing.

Example fix

# before
(no index configuration for shared-lib)
# after
quarkus.index-dependency.shared.group-id=com.acme
quarkus.index-dependency.shared.artifact-id=shared-lib
Defensive patterns

Strategy: validation

Validate before calling

static void requireIndexed(io.quarkus.builder.index.IndexView index, org.jboss.jandex.DotName name) {
    if (index.getClassByName(name) == null)
        throw new IllegalStateException("Class not indexed: " + name + "; add quarkus.index-dependency for its artifact");
}
// config check:
// quarkus.index-dependency.shared.group-id=com.acme
// quarkus.index-dependency.shared.artifact-id=shared-lib

Type guard

boolean isIndexed = index.getClassByName(superType.name()) != null;

Try / catch

try { augment(); } catch (BuildException e) { if (e.getMessage().contains("is not inside the Jandex index")) { /* add index-dependency config or generated-source indexing */ } else throw e; }

Prevention

When it happens

Trigger: Calling JandexUtil.isSubclassOf (directly or via build steps) on a class whose superclass is missing from the index — e.g. a class extending a JDK class, a dependency class excluded from indexing, or generated bytecode not added to the index.

Common situations: Classes extending non-application classes (java.* / framework classes) that are not indexed; additional-modules or index configuration omitting a dependency jar; QuarkusAnnotationProcessor/Jandex maven plugin not configured for generated sources; classloading artifacts in tests.

Related errors


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