Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource Spring Boot
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Failed to bind properties under ... to com.zaxxer.hikari.HikariDataSource usually means Spring Boot found configuration that was intended for a data source, but could not map it cleanly into the Hikari configuration object. The actual cause is often mundane: the wrong property prefix, a misspelled key, YAML indentation, or mixing url and jdbc-url in the wrong place. The fastest fix is to stop treating it as a mysterious Hikari problem and inspect the exact property binding path.
What Spring Boot Is Trying to Bind
Spring Boot reads properties from application.properties or application.yml, matches them to a configuration prefix, and binds them into an object. For a default data source setup, that usually means keys under spring.datasource.
A minimal working example looks like this:
If you are configuring Hikari-specific settings, they usually live under the Hikari sub-prefix:
If the prefix is wrong or the keys are malformed, binding fails before the application can start cleanly.
Common Real Causes
The most common causes are:
- typo in the property name
- bad YAML indentation
- custom
@ConfigurationPropertiesprefix that does not match the file - missing JDBC driver dependency
- profile-specific config file not being loaded
- using Hikari property names in the wrong section
For example, this YAML looks close to correct but is broken if indentation is off:
One misplaced indent can be enough to make the binder think the values belong to a different object or no object at all.
Custom DataSource Beans Need Matching Prefixes
A very common advanced-case error happens when you define your own DataSource bean with @ConfigurationProperties and then forget that the prefix changed.
If you use that bean definition, the properties must live under app.datasource, not spring.datasource:
When the prefix and the file do not match, the binder error can look like a Hikari failure even though the real problem is configuration layout.
How to Debug It Quickly
Start with the exception message and look for the property path Spring mentions. Then check:
- which config file is active
- which Spring profile is active
- which bean prefix is being used
- whether the JDBC driver dependency is on the classpath
- whether the property names are valid for the object being bound
The shortest path to a fix is often to reduce the configuration to a minimal working set, start the app, and then add pool properties back one at a time.
Common Pitfalls
- Mixing
spring.datasourcekeys with a custom@ConfigurationPropertiesprefix. - Assuming the binder is wrong when the real issue is YAML indentation.
- Using pool-specific keys under the wrong prefix.
- Forgetting that a different Spring profile may be loading a different file than the one you just edited.
- Chasing Hikari internals before confirming the datasource URL, username, password, and driver are valid.
Summary
- This error usually means Spring Boot could not map datasource properties into
HikariDataSourcecleanly. - The most common causes are wrong prefixes, typos, indentation problems, and missing dependencies.
- For the default datasource, start with
spring.datasource.url,username, andpassword. - If you define a custom datasource bean, the property prefix in code and config must match exactly.
- Debug the binding path first; most fixes are configuration corrections, not Hikari code changes.

