{"record":{"id":"469c63f7c0193e55","repo":"quarkusio/quarkus","slug":"entity-entity-was-not-part-of-the-quarkus-index-469c63","errorCode":null,"errorMessage":"Entity ${entity} was not part of the Quarkus index","messagePattern":"Entity (.+?) was not part of the Quarkus index","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/StockMethodsAdder.java","lineNumber":244,"sourceCode":"                    ParamVar methodParam = bmc.parameter(\"entity\");\n                    bmc.body(bbc -> {\n                        Expr castedParam = bbc.cast(methodParam, ClassDesc.of(entityTypeStr));\n                        Expr result = bbc.invokeVirtual(saveDesc, bmc.this_(), castedParam);\n                        bbc.return_(result);\n                    });\n                });\n                existingMethods.add(bridgeSaveKey);\n            }\n\n            allMethodsToBeImplementedToResult.put(saveKey, true);\n            allMethodsToBeImplementedToResult.put(bridgeSaveKey, true);\n        }\n    }\n\n    private boolean isPersistable(DotName entityDotName) {\n        ClassInfo classInfo = index.getClassByName(entityDotName);\n        if (classInfo == null) {\n            throw new IllegalStateException(\"Entity \" + entityDotName + \" was not part of the Quarkus index\");\n        }\n\n        if (classInfo.interfaceNames().contains(DotNames.SPRING_DATA_PERSISTABLE)) {\n            return true;\n        }\n\n        DotName superDotName = classInfo.superName();\n        if (superDotName.equals(DotNames.OBJECT)) {\n            return false;\n        }\n\n        return isPersistable(superDotName);\n    }\n\n    private void generatePersistAndReturn(Expr entity, BlockCreator bc, Expr opsExpr) {\n        bc.invokeVirtual(\n                MethodDesc.of(AbstractManagedJpaOperations.class, \"persist\", void.class, Object.class),\n                opsExpr,","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/StockMethodsAdder.java#L226-L262","documentation":"During Quarkus build, the Spring Data JPA extension scans the application index (Jandex) to resolve repository entity classes. When saving/inspecting an entity (isPersistable), the entity's DotName cannot be found in the index, meaning the class was never indexed. Quarkus throws because it cannot generate the stock save method without the entity metadata.","triggerScenarios":"A Spring @Repository interface targets an entity class that is not part of the Jandex index: the entity is in a dependency JAR that isn't indexed (no Jandex META-INF/jandex.idx and no quarkus.index-dependency configured), or the entity is generated at runtime, or the entity class name is referenced via a custom base repository generic that points outside the app modules.","commonSituations":"Entity classes live in a shared library JAR without Jandex indexing; multi-module Maven/Gradle projects where the entity module isn't a Quarkus extension dependency; entities created by annotation processors after indexing.","solutions":["Add quarkus.index-dependency.<name>.group-id / .artifact-id (and classifier if needed) in application.properties so the JAR containing the entity gets indexed","Rebuild the library JAR with the Jandex Maven/Gradle plugin so it ships META-INF/jandex.idx","Verify the repository's entity generic parameter matches a real @Entity class on the compile classpath","Move the entity into the application module (which is always indexed)"],"exampleFix":"// before (application.properties)\n# no indexing of shared-entities.jar\n\n// after\nquarkus.index-dependency.entities.group-id=com.example\nquarkus.index-dependency.entities.artifact-id=shared-entities","handlingStrategy":"validation","validationCode":"// Before building, verify entity module is indexed in application.properties:\n// quarkus.index-dependency.entities.group-id=com.example\n// quarkus.index-dependency.entities.artifact-id=shared-entities\n// Or check the JAR:\n// unzip -l shared-entities.jar | grep jandex.idx","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always ship entity libraries with the Jandex Maven/Gradle indexer plugin","Keep entities in the application module when possible","Run a quick build early when adding a new dependency containing entities","Document required quarkus.index-dependency entries in the entity library README"],"tags":["quarkus","jandex","spring-data-jpa","build-time","indexing"],"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"}