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
RoutingDataSourceHealthContributor should heed Maps with null values in keys #27694
Labels
status: superseded
An issue that has been superseded by another
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Aug 16, 2021
philwebb
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Aug 16, 2021
thegeekyasian
pushed a commit
to thegeekyasian/spring-boot
that referenced
this issue
Aug 16, 2021
The RoutingDataSourceHealthContributor constructor throws a NullPointerException (NPE) if the provided map has a null key. With this commit the NPE issue has been fixed by filtering the entries that are not-null. This closes spring-projects#27694
@philwebb, a PR has been created to fix the null pointer by filtering the entries with the non-null only. Can you please review and share your thoughts? |
Thanks @thegeekyasian, I've added a comment to the pull-request. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Closing in favor of PR #27698 |
philwebb
added
status: superseded
An issue that has been superseded by another
and removed
type: bug
A general bug
labels
Aug 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
spring-boot/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfiguration.java
Line 130 in b65cc4d
I just upgraded our project from springboot 2.4.1 to 2.5.3. I am super exited, that there is support for AbstractRoutingDataSource now. Thank' and kudos for that!
Due to the update the health check now run's into an NPE which kills the whole application.
It happens because the entryset 'routingDataSource.getResolvedDataSources().entrySet()' contains null as a key.
We create our datasource like this:
It might be strange or even stupid to put 'null' as a key into a map, but the RoutingDataSourceHealthContributor shouldn't crash because of that anyway.
The text was updated successfully, but these errors were encountered: