{"record":{"id":"eab3c14c15d49fde","repo":"quarkusio/quarkus","slug":"t-name-is-not-in-the-quarkus-jandex-index-and","errorCode":null,"errorMessage":"${t.name()} is not in the Quarkus Jandex index and cannot be used as a query return type. Consider using a simpler type or ensure this class is properly indexed. ","messagePattern":"(.+?) is not in the Quarkus Jandex index and cannot be used as a query return type\\. Consider using a simpler type or ensure this class is properly indexed\\. ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/AbstractMethodsAdder.java","lineNumber":321,"sourceCode":"    protected Type verifyQueryResultType(Type t, IndexView index) {\n        if (isHibernateSupportedReturnType(t.name())) {\n            return t;\n        }\n        if (t.kind() == Type.Kind.ARRAY) {\n            return verifyQueryResultType(t.asArrayType().constituent(), index);\n        } else if (t.kind() == Type.Kind.PARAMETERIZED_TYPE) {\n            final List<Type> types = t.asParameterizedType().arguments();\n            if (types.size() == 1 && isKnownContainerType(t.name())) {\n                return verifyQueryResultType(types.get(0), index);\n            } else {\n                for (Type type : types) {\n                    verifyQueryResultType(type, index);\n                }\n            }\n        } else {\n            final ClassInfo typeClass = index.getClassByName(t.name());\n            if (typeClass == null) {\n                throw new IllegalStateException(\n                        t.name() + \" is not in the Quarkus Jandex index and cannot be used as a query return type. \" +\n                                \"Consider using a simpler type or ensure this class is properly indexed. \");\n            }\n        }\n        return t;\n    }\n\n    private static boolean isKnownContainerType(DotName name) {\n        return DotNames.LIST.equals(name)\n                || DotNames.COLLECTION.equals(name)\n                || DotNames.SET.equals(name)\n                || DotNames.OPTIONAL.equals(name)\n                || DotNames.STREAM.equals(name)\n                || DotNames.ITERATOR.equals(name)\n                || DotNames.SPRING_DATA_PAGE.equals(name)\n                || DotNames.SPRING_DATA_SLICE.equals(name);\n    }\n","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/AbstractMethodsAdder.java#L303-L339","documentation":"During augmentation, Quarkus verifies that the return type of a query method is resolvable in the Jandex index of the application. If the class named by the type (t.name()) is not found in the index, code generation cannot reason about it as a query result and the build fails with this IllegalStateException. Every class used as a query result must be part of the application (or a dependency) that Jandex indexes.","triggerScenarios":"A repository finder returning a type from an unindexed jar (a dependency without a Jandex index / META-INF/jandex.idx and not registered via quarkus.index-dependency.*), a dynamically generated class, or a class outside the application's indexed classes.","commonSituations":"Projection classes living in a third-party library; forgetting quarkus.index-dependency.<name>.group-id/artifact config for an unindexed dependency; multi-module setups where the sibling module wasn't built with the Jandex index; using a JDK/external type (e.g. a DTO from a non-Quarkus lib) as a return type.","solutions":["Move the projection/DTO class into your application source so it gets indexed","If the class is in a dependency, add quarkus.index-dependency.<name>.group-id and quarkus.index-dependency.<name>.artifact-id in application.properties","Run 'mvn quarkus:index' (jandex-maven-plugin) on the library module to produce META-INF/jandex.idx","Use a simpler/indexed type (entity class or a local projection) instead"],"exampleFix":"// before (application.properties): dependency not indexed\n# nothing\n// after\nquarkus.index-dependency.mydto.group-id=com.example\nquarkus.index-dependency.mydto.artifact-id=my-dto-lib","handlingStrategy":"validation","validationCode":"// Verify the return type is available to Jandex before using it in a repository\ntry (var is = Thread.currentThread().getContextClassLoader()\n        .getResourceAsStream(\"com/example/MyProjection.class\")) {\n    if (is == null) throw new IllegalStateException(\"Return type not on classpath/index\");\n}\n// or ensure quarkus.index-dependency.<name>.group-id/artifact-id is set for external libs","typeGuard":null,"tryCatchPattern":"try {\n    buildRepository();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"not in the Quarkus Jandex index\")) {\n        log.error(\"Index the class or move it into the app: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Keep projection/DTO return types in your own application source","Register unindexed dependencies with quarkus.index-dependency.*","Run jandex-maven-plugin on library modules","Avoid exotic/generated classes as query return types"],"tags":["spring-data-jpa","quarkus","jandex","indexing","build-time"],"backgroundTag":"class-not-in-jandex-index","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}