{"record":{"id":"86849e5d638d4eca","repo":"quarkusio/quarkus","slug":"spel-expressions-are-not-currently-supported-offe","errorCode":null,"errorMessage":"spEL expressions are not currently supported. Offending method is ${methodName} of Repository ${repositoryName}","messagePattern":"spEL expressions are not currently supported\\. Offending method is (.+?) of Repository (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/CustomQueryMethodsAdder.java","lineNumber":105,"sourceCode":"\n            AnnotationInstance queryInstance = method.annotation(DotNames.SPRING_DATA_QUERY);\n            AnnotationInstance namedQueryInstance = getNamedQueryForMethod(method, entityClassInfo);\n\n            String methodName = method.name();\n            String repositoryName = repositoryClassInfo.name().toString();\n            String queryString;\n            if (queryInstance != null) {\n                verifyQueryAnnotation(queryInstance, methodName, repositoryName);\n                queryString = queryInstance.value(QUERY_VALUE_FIELD).asString().trim();\n            } else if (namedQueryInstance != null) {\n                queryString = namedQueryInstance.value(NAMED_QUERY_FIELD).asString().trim();\n            } else {\n                // handled by DerivedMethodsAdder\n                continue;\n            }\n\n            if (queryString.contains(\"#{\")) {\n                throw new IllegalArgumentException(\"spEL expressions are not currently supported. \" +\n                        \"Offending method is \" + methodName + \" of Repository \" + repositoryName);\n            }\n\n            if (!(queryString.startsWith(\"select\") || queryString.startsWith(\"SELECT\")\n                    || queryString.startsWith(\"from\") || queryString.startsWith(\"FROM\")\n                    || queryString.startsWith(\"delete\") || queryString.startsWith(\"DELETE\")\n                    || queryString.startsWith(\"update\") || queryString.startsWith(\"UPDATE\"))) {\n                throw new IllegalArgumentException(\"Unsupported query type in @Query. \" +\n                        \"Offending method is \" + methodName + \" of Repository \" + repositoryName);\n            }\n\n            List<Type> methodParameterTypes = method.parameterTypes();\n            String[] methodParameterTypesStr = new String[methodParameterTypes.size()];\n            List<Integer> queryParameterIndexes = new ArrayList<>(methodParameterTypes.size());\n            Integer pageableParameterIndex = null;\n            Integer sortParameterIndex = null;\n            for (int i = 0; i < methodParameterTypes.size(); i++) {\n                DotName parameterType = methodParameterTypes.get(i).name();","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/CustomQueryMethodsAdder.java#L87-L123","documentation":"Spring Data JPA @Query annotations may contain SpEL (Spring Expression Language) expressions delimited by #{...}. Quarkus's Spring Data JPA compatibility layer does not implement SpEL evaluation, so at build time it rejects such queries with this IllegalArgumentException. The build fails because the query string cannot be processed without Spring's expression machinery.","triggerScenarios":"Annotating a repository method with @Query whose value contains a SpEL expression such as #{#entityName}, #{#n}, or any other #{...} construct.","commonSituations":"Porting an existing Spring Boot application to Quarkus where queries used SpEL for dynamic entity names or parameter references; copy-pasting queries from Spring documentation that rely on #{#entityName}.","solutions":["Rewrite the query without SpEL: inline the entity name and replace SpEL parameter references with standard :namedParameter syntax","Remove #{#entityName} and write the entity class name directly in the query","Use derived query methods (findBy...) instead of custom queries where possible","If SpEL is essential, use plain Spring Data JPA (Spring Boot) instead of the Quarkus compatibility layer"],"exampleFix":"// before\n@Query(\"select u from #{#entityName} u where u.name = :n\")\nList<User> findByName(@Param(\"n\") String n);\n// after\n@Query(\"select u from User u where u.name = :n\")\nList<User> findByName(@Param(\"n\") String n);","handlingStrategy":"validation","validationCode":"// Reject SpEL before porting the query\nif (query != null && query.contains(\"#{\")) {\n    throw new IllegalArgumentException(\"Replace SpEL \" + query + \" with plain JPQL\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    compile();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"spEL expressions are not currently supported\")) {\n        log.error(\"Rewrite query without #{} expressions\");\n    }\n    throw e;\n}","preventionTips":["Never use #{...} in @Query values on Quarkus","Replace #{#entityName} with the literal entity class name","Use derived query methods when dynamic behavior comes from SpEL","Search migrated Spring code for '#{' before building"],"tags":["spring-data-jpa","quarkus","spel","unsupported-feature","build-time"],"backgroundTag":"spel-expression-unsupported","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"}