Bird
0
0

A developer sets spring.datasource.url in application.yml but the app uses a different database URL at runtime. What should be checked first?

medium📝 Debug Q7 of 15
Spring Boot - Application Configuration
A developer sets spring.datasource.url in application.yml but the app uses a different database URL at runtime. What should be checked first?
AIf the database server is running
BIf the YAML syntax is invalid
CIf the property is set in application.properties
DIf an environment variable overrides the property
Step-by-Step Solution
Solution:
  1. Step 1: Understand configuration precedence

    Environment variables override properties in YAML or properties files.
  2. Step 2: Identify likely cause of override

    If app uses different URL, environment variable probably overrides the YAML setting.
  3. Final Answer:

    If an environment variable overrides the property -> Option D
  4. Quick Check:

    Env vars override YAML properties [OK]
Quick Trick: Check environment variables for overrides first [OK]
Common Mistakes:
  • Assuming YAML syntax error without checking overrides
  • Ignoring environment variables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes