-
Notifications
You must be signed in to change notification settings - Fork 41.2k
DataSourceInitializer throws an InvalidConfigurationPropertyValueException with the wrong property name when using custom DataSourceProperties #13753
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
Comments
That probably largely reduces the interest of |
The only thing that I could think of was for something (the binding post-processor?) to keep a map of the beans that have bean bound and the prefix that was used. We could then ask for the prefix for the |
It also means we don't get the failure analysis. |
I am not sure I got that. Or do you mean that the failure analysis shows the wrong prefix? |
From what I could tell there would be no failure analysis when the property name is wrong. |
We discussed this on the call and decided that we could move the validation up to a |
This solution isn't great since it jumps through a few different exceptions. We should probably put this on hold till #14880 is done. |
Although that might mean that this doesn't end up in 2.0.x |
This doesn't happen any more in 2.5 due to the script-based initialization being decoupled from If we want to keep the old behaviour and make it more accurate, we could allow a callback to be configured or a method to be sub-classed on We don't have this sort of behaviour in many other places so I'm skeptical that it warrants adding complexity to the API of |
Yeah, I thought that adding this exception would be generally useful but it turned out that we don't have many practical case of it, especially considering we're trying to rationalize and let folks use the lower-level API for advanced use case. So +1 to that. |
Thanks, @snicoll. I'll close this one then. |
Consider the following app:
Running it results in the following exception being thrown:
The property name is incorrect. It is
spring.datasource.schema
but should beapp.datasource.schema
. We need to know the prefix that's been used to bind theDataSourceProperties
that we're working with.The text was updated successfully, but these errors were encountered: