{"record":{"id":"92546b5189cc6508","repo":"quarkusio/quarkus","slug":"fieldnotresolvablemessage-offendingmethodmessage","errorCode":null,"errorMessage":"fieldNotResolvableMessage + offendingMethodMessage","messagePattern":"fieldNotResolvableMessage \\+ offendingMethodMessage","errorType":"exception","errorClass":"UnableToParseMethodException","httpStatus":null,"severity":"error","filePath":"extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java","lineNumber":517,"sourceCode":"        FieldInfo fieldInfo = null;\n\n        MutableReference<List<ClassInfo>> parentSuperClassInfos = new MutableReference<>();\n        int fieldStartIndex = 0;\n        ClassInfo parentFieldInfo = null;\n        while (fieldStartIndex < fieldPathExpression.length()) {\n            // The underscore character is treated as reserved character to manually define traversal points.\n            // This means that path expression may have multiple levels separated by the '_' character. For example: person_address_city.\n            if (fieldPathExpression.charAt(fieldStartIndex) == '_') {\n                // See issue #34395\n                // For resolving correctly nested fields added using '_' we need to get the previous fieldInfo which will be the class containing the field starting by '_' in this loop.\n                DotName parentFieldInfoName;\n                if (fieldInfo != null && fieldInfo.type().kind() == Type.Kind.PARAMETERIZED_TYPE) {\n                    parentFieldInfoName = fieldInfo.type().asParameterizedType().arguments().stream().findFirst().get().name();\n                    parentFieldInfo = indexView.getClassByName(parentFieldInfoName);\n                }\n                fieldStartIndex++;\n                if (fieldStartIndex >= fieldPathExpression.length()) {\n                    throw new UnableToParseMethodException(fieldNotResolvableMessage + offendingMethodMessage);\n                }\n            }\n            int firstSeparator = fieldPathExpression.indexOf('_', fieldStartIndex);\n            int fieldEndIndex = firstSeparator == -1 ? fieldPathExpression.length() : firstSeparator;\n            while (fieldEndIndex >= fieldStartIndex) {\n                String fieldName = fieldPathExpression.substring(fieldStartIndex, fieldEndIndex);\n                String simpleFieldName = lowerFirstLetter(fieldName);\n                fieldInfo = getFieldInfo(simpleFieldName, parentFieldInfo == null ? parentClassInfo : parentFieldInfo,\n                        parentSuperClassInfos);\n                if (fieldInfo != null) {\n                    break;\n                }\n                fieldEndIndex = previousPotentialFieldEnd(fieldPathExpression, fieldStartIndex, fieldEndIndex);\n            }\n            if (fieldInfo == null) {\n                String detail = \"\";\n                if (fieldStartIndex > 0) {\n                    String notMatched = lowerFirstLetter(fieldPathExpression.substring(fieldStartIndex));","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java#L499-L535","documentation":"While resolving a possibly underscore-separated (nested) field path in a derived query method, the parser consumed a segment but ran off the end of the expression without finding a next segment, meaning the path was truncated. It throws UnableToParseMethodException with the 'Entity ... does not contain a field named: ...' prefix.","triggerScenarios":"A method name field path ends with an underscore or trailing separator, e.g. findByAddress_ (nothing after '_'), or the path after the last '_' is empty — fieldStartIndex reaches fieldPathExpression.length().","commonSituations":"Half-deleted nested path during refactoring; auto-generated method names with dangling separators; typos where the final segment was omitted.","solutions":["Complete the field path after the underscore: findByAddress_City(...)","Remove the trailing underscore if the field is not nested: findByAddress(...)","Use @Query with explicit JPQL for complex nested paths"],"exampleFix":"// before\nList<User> findByAddress_();\n// after\nList<User> findByAddress_City(String city);","handlingStrategy":"validation","validationCode":"// Check for dangling separators in method names:\n// assertFalse(methodName.contains(\"__\") || methodName.endsWith(\"_\"), methodName);","typeGuard":null,"tryCatchPattern":"try {\n    parser.parse(methodName);\n} catch (UnableToParseMethodException e) {\n    // complete or remove the trailing underscore path\n    throw new IllegalStateException(\"Truncated nested path: \" + e.getMessage());\n}","preventionTips":["Never end a field path with an underscore","Use underscore-separated full paths: findByAddress_City(...)","Review auto-generated or scripted repository method names for truncated paths"],"tags":["jpa","spring-data","derived-query","field-not-found"],"backgroundTag":"entity-field-not-resolvable","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"}