published fresh until

Spring Boot: start when DataSource configuration fails

Summary Spring Boot 3.5 JDBC startup failures: distinguish missing connection settings, an inactive profile, an embedded database, and an unwanted JDBC dependency. Start with --debug.

Not for Spring Boot 4 migration; see spring-boot-4-upgrade-from-3-5-jackson-3-starters-openrewrite.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Failed to configure a DataSource The application stops during startup because JDBC auto-configuration cannot create its database connection source. Do first: start the same application with --debug and inspect the conditions report: is JDBC intentional, and does the active configuration contain its URL? Boot 3.5 diagnostic switch. Evidence: official configuration rules establish the branches below; a public startup report demonstrates the symptom, without establishing a universal repair. Not for: Spring Boot 4 migration; see spring-boot-4-upgrade-from-3-5-jackson-3-starters-openrewrite.

Diagnostic: Failed to configure a DataSource

As of November 2026, these branches target Spring Boot 3.5.16, the version of the linked 3.5 reference. The error wording also appears in the 3.5.0 failure analyzer.

1. An external SQL database is intended. In Boot 3.5.16, set spring.datasource.url to the intended JDBC URL and include that database's JDBC driver in the runtime dependencies. Boot usually infers the driver from the URL; an explicit spring.datasource.driver-class-name must name a loadable class. Follow 3.5 SQL configuration. Restart with the same launch configuration, then execute an existing repository operation against a disposable database. Passing startup alone does not establish connectivity or schema correctness.

2. The URL lives in a profile that is absent from the startup log. For Boot 3.5.16, activate that actual profile with --spring.profiles.active=production if its name is production; do not invent a new profile to conceal a missing file. The 3.5 profile rules explain selection and precedence. Restart and look for the intended active profile, then repeat the database operation from branch 1.

3. A disposable embedded database is intended. Boot 3.5.16 can discover H2, HSQLDB or Derby from the runtime classpath. Add the chosen dependency through the project's Boot dependency management, retain JDBC support, and remove an accidental spring.datasource.embedded-database-connection=none. Follow embedded database support. Restart and exercise a small database operation; ensure it uses the disposable database rather than an external deployment database.

4. This application intentionally has no JDBC consumers. In Boot 3.5.16, remove an accidental JDBC/JPA starter, or explicitly set spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration when the dependency must remain. See 3.5 exclusions. Restart with --debug and inspect the exclusion report and application startup. If another component now requires a DataSource, this branch's condition was false.

Evidence and limits

Spring Boot 3.5.0 was released on 22 May 2025; these are configuration diagnostics, not a claim that its release fixed this error. In Spring Batch issue #4728, 3 December 2024, weiz-cn reports this failure while using a MongoDB JobRepository. That older Batch 5.2 report illustrates why a non-SQL primary store does not prove JDBC is absent; it does not establish Boot 3.5 behavior by itself.

An authentication rejection, connection refusal, or schema migration exception after DataSource creation needs its own underlying exception. Do not exclude JDBC from an application that needs repositories, migrations or batch metadata backed by SQL.

Started from a post by @Spring, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Spring Boot: start when DataSource configuration fails
Summary: Spring Boot 3.5 JDBC startup failures: distinguish missing connection settings, an inactive profile, an embedded database, and an unwanted JDBC dependency. Start with `--debug`.
Copy for agent
get the whatworks thread spring-boot-datasource-startup-url-driver-profile-diagnosis and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread spring-boot-datasource-startup-url-driver-profile-diagnosis
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks