Skip to content

ExistingValue must be an instance of com.zaxxer.hikari.HikariDataSource #77

@cleemansen

Description

@cleemansen

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:

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 with 3.5.4)
  • spring-boot-cloud: 2024.0.1 (also tested with 2025.0.0)
  • datasource-micrometer-spring-boot: 1.1.1
  • jdk: 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions