-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hey,
I'm facing the same error as already reported in #25. The suggested fix spring.cloud.refresh.never-refreshable=net.ttddyy.dsproxy.support.ProxyDataSource does not work for me / anymore.
I debugged the affected stack trace a little bit - these are my findings:
org.springframework.cloud.context.properties.ConfigurationPropertiesRebinderis my starting pointorg.springframework.cloud.context.properties.ConfigurationPropertiesRebinder#rebind(java.lang.String, org.springframework.context.ApplicationContext)ignores beans listed inspring.cloud.refresh.never-refreshable- When iterating over the
HikariDataSourcebean, the following ignore checks are happening:getNeverRefreshable().contains(bean.getClass().getName()): does not match asbean.getClass().getName()resolves tojdk.proxy2.$Proxy156(was this perhaps the mentionednet.ttddyy.dsproxy.support.ProxyDataSourcein the past?)getNeverRefreshable().contains(name): does not match as thenamevalue isdataSource
- Therefore, the bean does not get ignored and a (failing) rebind is initiated
So my fix is to set spring.cloud.refresh.never-refreshable=dataSource.
Please let me know if this doesn't make sense to you.
spring-boot:3.4.5(also tested with3.5.4)spring-boot-cloud:2024.0.1(also tested with2025.0.0)datasource-micrometer-spring-boot:1.1.1jdk:21.0.6-tem
o.s.c.h.RefreshScopeHealthIndicator : Health check failed
java.lang.IllegalArgumentException: ExistingValue must be an instance of com.zaxxer.hikari.HikariDataSource
at org.springframework.util.Assert.isTrue(Assert.java:135)
at org.springframework.boot.context.properties.bind.Bindable.withExistingValue(Bindable.java:193)
at org.springframework.boot.context.properties.ConfigurationPropertiesBean.get(ConfigurationPropertiesBean.java:207)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:79)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:429)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1810)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:419)
at org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder.rebind(ConfigurationPropertiesRebinder.java:139)
at org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder.rebind(ConfigurationPropertiesRebinder.java:98)
at org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder.rebind(ConfigurationPropertiesRebinder.java:86)
at org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder.onApplicationEvent(ConfigurationPropertiesRebinder.java:171)
at org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder.onApplicationEvent(ConfigurationPropertiesRebinder.java:54)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:454)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387)
at org.springframework.cloud.context.refresh.ContextRefresher.refreshEnvironment(ContextRefresher.java:102)
at org.springframework.cloud.context.refresh.ContextRefresher.refresh(ContextRefresher.java:93)
at org.springframework.cloud.endpoint.RefreshEndpoint.refresh(RefreshEndpoint.java:46)
Metadata
Metadata
Assignees
Labels
No labels