{"record":{"id":"db5c2ad5d1b7d549","repo":"quarkusio/quarkus","slug":"entity-entity-was-not-part-of-the-quarkus-index","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/SpringDataRepositoryCreator.java","lineNumber":67,"sourceCode":"        this.stockMethodsAdder = new StockMethodsAdder(index, typeBundle);\n        this.derivedMethodsAdder = new DerivedMethodsAdder(index, typeBundle, otherClassOutput, customClassCreatedCallback);\n\n        // custom queries may generate non-bean classes\n        this.customQueryMethodsAdder = new CustomQueryMethodsAdder(index, otherClassOutput, customClassCreatedCallback,\n                typeBundle);\n    }\n\n    public Result implementCrudRepository(ClassInfo repositoryToImplement, IndexView indexView) {\n        Map.Entry<DotName, DotName> extraTypesResult = extractIdAndEntityTypes(repositoryToImplement, indexView);\n\n        DotName idTypeDotName = extraTypesResult.getKey();\n        String idTypeStr = idTypeDotName.toString();\n        DotName entityDotName = extraTypesResult.getValue();\n        String entityTypeStr = entityDotName.toString();\n\n        ClassInfo entityClassInfo = index.getClassByName(entityDotName);\n        if (entityClassInfo == null) {\n            throw new IllegalStateException(\"Entity \" + entityDotName + \" was not part of the Quarkus index\");\n        }\n\n        // handle the fragment repositories\n        // Spring Data allows users to define (and implement their own interfaces containing data access related methods)\n        // that can then be used along with any of the typical Spring Data repository interfaces in the final\n        // repository in order to compose functionality\n\n        List<DotName> interfaceNames = repositoryToImplement.interfaceNames();\n        List<DotName> fragmentNamesToImplement = new ArrayList<>(interfaceNames.size());\n        for (DotName interfaceName : interfaceNames) {\n            if (!DotNames.SUPPORTED_REPOSITORIES.contains(interfaceName)\n                    && !GenerationUtil.isIntermediateRepository(interfaceName, indexView)) {\n                fragmentNamesToImplement.add(interfaceName);\n            }\n        }\n\n        Map<String, FieldDesc> fragmentImplNameToFieldDescriptor = new HashMap<>();\n        String repositoryToImplementStr = repositoryToImplement.name().toString();","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/SpringDataRepositoryCreator.java#L49-L85","documentation":"When generating a CRUD repository implementation, Quarkus resolves the entity type from the repository's generic signature and then looks the entity class up in the Jandex index. This error means the entity class resolved from generics was not found in the index, so its fields/methods cannot be inspected to generate queries.","triggerScenarios":"A repository extends CrudRepository/Repository with an entity type parameter that resolves to a class not present in the build-time index — e.g. entity defined in an un-indexed dependency JAR, or a generated class not yet on the index.","commonSituations":"Entities in a separate module/JAR without a Jandex index; wrong generic parameter (interface or abstract class from another library); stale incremental build; entities produced by annotation processing not indexed.","solutions":["Put the entity class in the application's own source tree, or index its containing JAR (jandex-maven-plugin producing META-INF/jandex.idx, or quarkus.index-dependency.<name>.coordinates in application.properties)","Verify the repository's entity generic parameter is the concrete @Entity class actually used by the persistence unit","Run a clean rebuild to refresh the index"],"exampleFix":"// application.properties\n// before: dependency un-indexed\n// after:\nquarkus.index-dependency.entities.group-id=com.example\nquarkus.index-dependency.entities.artifact-id=my-entities","handlingStrategy":"validation","validationCode":"// Ensure the entity referenced by the repository is an application class or an indexed dependency\n// repository: interface UserRepo extends CrudRepository<User, Long>\nassert new java.io.File(\"src/main/java/com/example/User.java\").exists()\n  || pomContainsIndexDependency(\"com.example\",\"my-entities\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep @Entity classes in the application or in JARs built with the jandex-maven-plugin","Register entity-only dependencies via quarkus.index-dependency.*","Always use the concrete @Entity class as the repository's first generic argument"],"tags":["quarkus","spring-data-jpa","jandex-index","entity","build-time"],"backgroundTag":"class-not-in-quarkus-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"}