DataSource url not specified Java Origin: Application & API OSI layer 7 · Application Last updated 14 Oct 2026

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

Spring Boot found JDBC/JPA on the classpath but no database URL.

Exact message you may see Failed to configure a DataSource'url' attribute is not specified
Seen on: Java

Meaning

Adding spring-boot-starter-data-jpa triggers DataSource auto-configuration. Without spring.datasource.url (or an embedded DB like H2), startup fails. Profile-specific properties not loading is another cause.

Common causes

  • spring.datasource.url missing
  • Active profile not set, so application-prod.properties not loaded
  • Environment variables not provided
  • JPA added but no database intended

⚡ Quick fix

  1. Set spring.datasource.url/username/password
  2. Activate the right profile (SPRING_PROFILES_ACTIVE)
  3. Add H2 for local dev, or exclude DataSourceAutoConfiguration if no DB is needed

Detailed fix by platform

Java

  1. spring.datasource.url=jdbc:postgresql://localhost:5432/app

How to diagnose

  1. Properties — Which file sets the URL?
  2. Profile — Which profile is active?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

1000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)1000AADSTS90002 — AADSTS90002: Tenant 'x' not found (Azure)AADSTS90002AH00558 — Apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name (Nginx / Apache)AH00558api_version_invalid — API Error: Invalid or unsupported API version (API)api_version_invalidAzureWebJobsStorage — Azure Functions: Value cannot be null. (Parameter 'connectionString') / Missing value for AzureWebJobsStorage (Azure)AzureWebJobsStoragecircular references — The dependencies of some of the beans in the application context form a cycle (Java)circular referencesConnectionString property has not been initialized — InvalidOperationException: The ConnectionString property has not been initialized (.NET)ConnectionString prop…divergent branches — hint: You have divergent branches and need to specify how to reconcile them. (Git)divergent branchesDataSourc…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.