-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document need for -parameters
flag in exception messages
#31675
Comments
Reopening to improve exception message in |
That's an interesting idea. For some use cases (e.g., mvc controller handler methods, and cache key generation) it would be relatively straightforward; however, for other uses (e.g., SpEL expressions, parameter named used as fallback qualifier for dependency injection by type) it may not be as straightforward to pin down what the trigger would be for such an exception. In any case, we'll discuss it amongst the team. |
Note to maintainersIf we modify the exception message currently used or introduce a new exception type, etc., we must make sure that the exception message contains Otherwise, we'll render Spring Boot's failure analysis useless, since it depends on the exception message containing exactly that sub-string. |
Overview
Since
-parameters
is required for certain use cases starting with Spring Framework 6.1, we should revise related exception messages to explicitly mention the solution.For example, a Spring MVC
@Controller
handler method with a@PathVariable String client
parameter declaration may fail with an exception similar to the following.To improve diagnostics, we should add something along the lines of
Ensure that the compiler uses the -parameters flag.
to the end of that exception message.Related Issues
LocalVariableTableParameterNameDiscoverer
completely (avoiding its exposure in native images) #29531NoUniqueBeanDefinitionException
when constructor/setter parameter name used as qualifier #31643@Bean
method with qualifier based on parameter name doesn't work in Spring 6.1 #31685The text was updated successfully, but these errors were encountered: