On updating our application to Spring Boot 3.2.5 and Spring framework 6.1.6. we are getting following Errors.
ERROR c.a.s.t.c.e.ControllerExceptionHandler - java.lang.IllegalArgumentException: Name for argument of type [java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.
java.lang.IllegalArgumentException: Name for argument of type [java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.
ERROR c.a.s.t.c.e.ControllerExceptionHandler - java.lang.IllegalArgumentException: Null key returned for cache operation caches=[infraRedFdc] | key='#envDcCacheKey' | keyGenerator='' | cacheManager='' | cacheResolver='' | condition='' | unless='' | sync='true']. If you are using named parameters, ensure that the compiler uses the '-parameters' flag.
java.lang.IllegalArgumentException: Null key returned for cache operation caches=[infraRedFdc] | key='#envDcCacheKey' | keyGenerator='' | cacheManager='' | cacheResolver='' | condition='' | unless='' | sync='true']. If you are using named parameters, ensure that the compiler uses the '-parameters' flag.
It seams, it is asking to compile(java) code with ‘-parameters’ flag. So for that, I have followed the directions on https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention:
I have added:
tasks.withType(JavaCompile).configureEach {
options.compilerArgs.add("-parameters")
}
Even i had tried adding following mentioned in Thread: https://github.com/spring-projects/spring-framework/issues/31729
tasks.withType(JavaCompile) {
configure(options) {
options.compilerArgs << '-parameters'
}
}
Nothing works for me.
I have used following configurations/tools:
- springBootVersion= 3.2.5
- springFrameworkVersion= 6.1.6
- Java= 17.0.5
- gradle= 8.7
- Vscode= 1.88.1
Could you please help me in resolving this issue.