{"record":{"id":"847c8dc59b896fcc","repo":"quarkusio/quarkus","slug":"entity-class-fieldinfo-type-name-referenced","errorCode":null,"errorMessage":"Entity class ${fieldInfo.type().name()} referenced by ${this.entityClass}.${fieldPathBuilder} was not part of the Quarkus index${typed ? \" or typed field could not be resolved properly. \" : \". \"}${offendingMethodMessage}","messagePattern":"Entity class (.+?) referenced by (.+?)\\.(.+?) 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/MethodNameParser.java","lineNumber":559,"sourceCode":"            if (fieldPathBuilder.length() > 0) {\n                fieldPathBuilder.append('.');\n            }\n            fieldPathBuilder.append(fieldInfo.name());\n            if (!isHibernateProvidedBasicType(fieldInfo.type().name())) {\n                DotName parentClassName;\n                boolean typed = false;\n                if (fieldInfo.type().kind() == Type.Kind.TYPE_VARIABLE) {\n                    typed = true;\n                    parentClassName = getParentNameFromTypedFieldViaHierarchy(fieldInfo, mappedSuperClassInfos);\n                } else if (fieldInfo.type().kind() == Type.Kind.PARAMETERIZED_TYPE) {\n                    parentClassName = fieldInfo.type().asParameterizedType().arguments().stream().findFirst().get().name();\n                } else {\n                    parentClassName = fieldInfo.type().name();\n                }\n                parentClassInfo = indexView.getClassByName(parentClassName);\n                parentSuperClassInfos.set(null);\n                if (parentClassInfo == null) {\n                    throw new IllegalStateException(\n                            \"Entity class \" + fieldInfo.type().name() + \" referenced by \"\n                                    + this.entityClass + \".\" + fieldPathBuilder\n                                    + \" was not part of the Quarkus index\"\n                                    + (typed ? \" or typed field could not be resolved properly. \" : \". \")\n                                    + offendingMethodMessage);\n                }\n\n            }\n            fieldStartIndex = fieldEndIndex;\n        }\n        return fieldInfo;\n    }\n\n    private int previousPotentialFieldEnd(String fieldName, int fieldStartIndex, int fieldEndIndexExclusive) {\n        for (int i = fieldEndIndexExclusive - 1; i > fieldStartIndex; i--) {\n            char c = fieldName.charAt(i);\n            if (c >= 'A' && c <= 'Z') {\n                return i;","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java#L541-L577","documentation":"During nested field resolution, the type of an intermediate field (e.g. the target of an association) could not be found in the Quarkus Jandex index. This is an IllegalStateException because the entity graph cannot be traversed — either the class was not indexed or a typed (generic/parameterized) field could not be resolved.","triggerScenarios":"Navigating an association in a derived method (e.g. findByAddress_City) where the Address class is not part of the application index (e.g. generated at runtime, in an unindexed jar, or lacking the relevant index inclusion); also for fields declared with type variables/raw types where the parameterized type argument cannot be resolved.","commonSituations":"Entities supplied by a third-party library whose JAR is not indexed; annotation processing generating entity classes after indexing; missing smallrye-index annotations or incorrect Quarkus index dependencies.","solutions":["Ensure the entity class's JAR is indexed by Quarkus (add quarkus-indexed dependencies or application.index dependencies for third-party entity jars)","Check that the association field is properly typed (e.g. Set<Address> not raw Set) so the parameterized type argument resolves","Rebuild with a clean build so the Jandex index includes all classes; verify the class appears in the index"],"exampleFix":"// before: raw/generic field prevents resolution\nprivate Set addresses;\n// after\nprivate Set<Address> addresses;","handlingStrategy":"validation","validationCode":"// Ensure the association target is indexed; check the built app's index or add:\n// quarkus.index-dependency.<name>.group-id / artifact-id in application.properties for third-party entity jars","typeGuard":null,"tryCatchPattern":"try {\n    // triggers augmentation/index lookup\n    em.getEntityManagerFactory();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"was not part of the Quarkus index\")) {\n        throw new IllegalStateException(\"Add the entity jar to quarkus.index-dependency: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Add quarkus.index-dependency.* entries for external JARs containing entities","Declare association fields with full parameterized types (Set<Address>, List<Order>)","Avoid runtime-generated entity classes; generate them before Quarkus indexing"],"tags":["jpa","spring-data","jandex-index","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-14T00:17:10.932Z"}