0

I have application with spring-boot-starter-actuator dependency. When I add my error handling library as dependency, application fails to start with the following message

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

After a bit research, I found out the error handling library introduces transitive dependency of spring-boot-starter-data-jpa which in turn causes actuator autoconfiguration to automatically introduce DataSourceHealthIndicator bean. This bean fails on missing database connection, but the application actually doesn't use database at all. However, the logging library requires the JPA dependency at runtime, so I can't exclude it.

I tried to set the following application property: management.health.db.enabled=false, but I still get the same error on startup. I can't find any documentation how to disable DataSourceHealthIndicator bean and leaving other autoconfiguration intact.

Tuomas Toivonen
  • 18,478
  • 39
  • 108
  • 200

0 Answers0