-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Configuration properties cannot be bound to DruidDataSource when the environment contains a non-enumerable property source #39840
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
This is quite similar to #38514 which the underlying cause being the same non-enumerable property source that comes from JNDI being available. You can work around the problem by adding a The failure's occurring because When all property sources are enumerable, binding can be optimised to only try to bind properties that are present in the environment. For example, if there are no When there's a non-enumerable property source in the environment, the binder does not know all of the properties that are available so it has to try to bind everything. As part of trying to bind everything, the binder's calling Hopefully the workaround above is enough to get you past the problem. I'll leave this open for now as I'm not sure what, if anything, we can do to address it. One option would be to provide a way to indicate properties that should be ignored when binding to a third-party class. Another would be for you to bind properties to a safe class of your own and then use Boot's properties.initializeDataSourceBuilder().type(DruidDataSource.class).build(); |
I know it's risky, but can we ignore |
I requested Spring Framework team to disable |
DbConfig.java
pom.xml
exception log:
After jetty is introduced, the
DruidDataSource.getConnection
method will be called when the @ConfigurationProperties property is filled.Causes
DruidDataSource.init
method initialization exceptionAfter removing jetty, the
DruidDataSource.getConnection
method is no longer called, which is weird.Reproduce project address: example
The text was updated successfully, but these errors were encountered: