quarkusio/quarkus · error · IllegalStateException

Unable to collect interfaces of + iface + because it was n

Error message

Unable to collect interfaces of  + iface +  because it was not indexed. Consider adding it to Jandex index

What it means

While recursively collecting all super-interfaces of a @ConfigProperties interface to generate implementations, Quarkus looks each interface up in the Jandex index. A super-interface not present in the index cannot be processed, so deployment fails with IllegalStateException.

Source

Thrown at extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/InterfaceConfigurationPropertiesUtil.java:301

                            }
                        });
                    });
                }
            }
        });

        return generatedClassName;
    }

    private static void collectInterfacesRec(ClassInfo current, IndexView index, Set<DotName> result) {
        List<DotName> interfaces = current.interfaceNames();
        if (interfaces.isEmpty()) {
            return;
        }
        for (DotName iface : interfaces) {
            ClassInfo classByName = index.getClassByName(iface);
            if (classByName == null) {
                throw new IllegalStateException("Unable to collect interfaces of " + iface
                        + " because it was not indexed. Consider adding it to Jandex index");
            }
            result.add(iface);
            collectInterfacesRec(classByName, index, result);
        }
    }

    /**
     * The interface implementations needs to be in the same package as the generated utility class that they extend.
     * The name also needs to be unique so there are no clashes if there are multiple interfaces
     * annotated with @ConfigProperties
     */
    private static String createName(DotName ifaceName, String prefixStr) {
        return ConfigurationPropertiesUtil.PACKAGE_TO_PLACE_GENERATED_CLASSES + "." + ifaceName.withoutPackagePrefix() + "_"
                + HashUtil.sha1(ifaceName.toString()) + "_" + HashUtil.sha1(prefixStr);
    }

    private static boolean isDefault(short flags) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add the jandex-maven-plugin to the library containing the parent interface so it ships a META-INF/jandex.idx
  2. Register the dependency for indexing with quarkus.index-dependency.<name>.group-id/artifact-id application properties
  3. Remove the unindexed parent interface (flatten members into the config interface)

Example fix

// application.properties before
(nothing)
// after
quarkus.index-dependency.commons.group-id=com.myco
quarkus.index-dependency.commons.artifact-id=commons-config
Defensive patterns

Strategy: validation

Validate before calling

// build-time check: ensure parent interfaces ship a Jandex index
boolean hasIndex(Dependency d) {
    return java.util.zip.ZipEntry exists d.jar("META-INF/jandex.idx");
}

Try / catch

catch (IllegalStateException e) { if (e.getMessage().contains("not indexed")) { /* configure quarkus.index-dependency.* */ } throw e; }

Prevention

When it happens

Trigger: A @ConfigProperties interface extends another interface that is not indexed by Jandex — e.g. the parent interface lives in a dependency JAR built without a Jandex index, or was excluded from indexing via quarkus.index-dependency configuration.

Common situations: Shared config interfaces in a company commons library without the jandex-maven-plugin; using a JDK or third-party interface as parent of a config interface.

Related errors


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