{"record":{"id":"7208c7e69e52a9bd","repo":"quarkusio/quarkus","slug":"spel-expressions-are-not-supported-when-using-org","errorCode":null,"errorMessage":"SpEL expressions are not supported when using @org.springframework.beans.factory.annotation.Value. Offending value is '<annotation>'","messagePattern":"SpEL expressions are not supported when using @org\\.springframework\\.beans\\.factory\\.annotation\\.Value\\. Offending value is '<annotation>'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-di/deployment/src/main/java/io/quarkus/spring/di/deployment/SpringDIProcessor.java","lineNumber":579,"sourceCode":"                char[] chars = name.toCharArray();\n                chars[0] = Character.toLowerCase(chars[0]);\n                return new String(chars);\n            }\n        } else {\n            return name;\n        }\n    }\n\n    private void addSpringValueAnnotations(AnnotationTarget target, AnnotationInstance annotation, boolean addInject,\n            Set<AnnotationInstance> annotationsToAdd) {\n        final AnnotationValue annotationValue = annotation.value();\n        if (annotationValue == null) {\n            return;\n        }\n        String defaultValue = null;\n        String stringValue = annotationValue.asString();\n        if (stringValue.contains(\"#{\")) {\n            throw new IllegalArgumentException(\n                    \"SpEL expressions are not supported when using \" + SPRING_VALUE_ANNOTATION + \". Offending value is '\"\n                            + annotation + \"'\");\n        }\n        String propertyName = stringValue.replace(\"${\", \"\").replace(\"}\", \"\");\n        if (propertyName.contains(\":\")) {\n            final int index = propertyName.indexOf(':');\n            if (index < propertyName.length() - 1) {\n                defaultValue = propertyName.substring(index + 1);\n            }\n            propertyName = propertyName.substring(0, index);\n\n        }\n        final List<AnnotationValue> annotationValues = new ArrayList<>();\n        annotationValues.add(AnnotationValue.createStringValue(\"name\", propertyName));\n        if (defaultValue != null && !defaultValue.isEmpty()) {\n            annotationValues.add(AnnotationValue.createStringValue(\"defaultValue\", defaultValue));\n        }\n        annotationsToAdd.add(create(","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-di/deployment/src/main/java/io/quarkus/spring/di/deployment/SpringDIProcessor.java#L561-L597","documentation":"Quarkus's Spring DI compatibility layer translates Spring's @Value annotation into Quarkus config injection. Spring Expression Language (SpEL) expressions cannot be translated to Quarkus config properties, so the processor rejects any @Value value containing the SpEL start marker '#{' at build time.","triggerScenarios":"Using @Value(\"#{...}\") with a SpEL expression (e.g. #{systemProperties['x']}, #{otherBean.field}, #{... + ...}) on a bean field, constructor param, or method param in a Spring-style bean processed by the spring-di extension.","commonSituations":"Migrating an existing Spring Boot app to Quarkus where @Value was used for SpEL-driven defaults, bean-to-bean lookups, or property concatenation; copying Spring examples that use SpEL into Quarkus.","solutions":["Replace the SpEL expression with a plain config property: @Value(\"${my.property}\") or @ConfigProperty(name=\"my.property\")","Move the SpEL logic into a @PostConstruct init method or a producer method in Java code","Use Quarkus SmallRye Config features (defaults, property expansion in application.properties) instead of SpEL","For bean-value lookups, inject the bean directly instead of via SpEL"],"exampleFix":"// before\n@Value(\"#{systemProperties['greeting'] ?: 'hello'}\")\nprivate String greeting;\n\n// after\n@ConfigProperty(name = \"greeting\", defaultValue = \"hello\")\nprivate String greeting;","handlingStrategy":"validation","validationCode":"// before build, scan @Value values\nString v = annotationValue;\nif (v != null && v.contains(\"#{\")) {\n    throw new IllegalStateException(\"SpEL not supported in @Value: \" + v);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never use #{ in @Value values; only ${prop} placeholders","Grep the codebase for '@Value(\"#{' during Spring-to-Quarkus migration","Prefer @ConfigProperty (SmallRye) for config injection in Quarkus"],"tags":["spring-di","spel","build-time","quarkus"],"backgroundTag":"spel-unsupported","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"}