Skip to content

SpEL containing argument references not working in Spring Boot 3.2.0-RC2 #38470

Closed as not planned
@ajujacob

Description

@ajujacob

SpEL expressions containing argument references (e.g., @PreAuthorize("@spELIssueDemoController.evaluateAccess(#allowAccess)")) throws the below exception in Spring Boot 3.2.0-RC2. This works without any issues in Spring Boot 3.1.5.

java.lang.IllegalArgumentException: Failed to evaluate expression '@spELIssueDemoController.evaluateAccess(#allowAccess)'
	at org.springframework.security.authorization.method.ReactiveExpressionUtils.lambda$evaluateAsBoolean$0(ReactiveExpressionUtils.java:41)

Here is a sample project that demonstrates this issue. Please refer to the README for more details about this issue and the steps to reproduce this issue.

A workaround for this issue is to add the "-parameters" flag during compilation. However, this isn't required in Spring Boot 3.1.5, which makes me believe it's a bug introduced in Spring Boot 3.2.0-RC2. Please let me know if you need more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions