Bird
0
0

What is the likely cause?

medium📝 Debug Q14 of 15
Spring Boot - Application Configuration
You have two configuration files: application.properties and application-prod.properties. You want to run the app with the prod profile but the app still uses settings from application.properties. What is the likely cause?
ASpring Boot does not support multiple configuration files.
BThe <code>application-prod.properties</code> file is missing a required property.
CThe app needs to be restarted twice to apply profiles.
DThe <code>spring.profiles.active</code> property is not set to <code>prod</code>.
Step-by-Step Solution
Solution:
  1. Step 1: Check profile activation

    Spring Boot uses spring.profiles.active to select which profile config to load.
  2. Step 2: Identify cause of fallback

    If spring.profiles.active is not set to prod, the app uses default application.properties.
  3. Final Answer:

    The spring.profiles.active property is not set to prod. -> Option D
  4. Quick Check:

    Profile must be activated to load its config [OK]
Quick Trick: Activate profile with spring.profiles.active [OK]
Common Mistakes:
  • Assuming file presence auto-activates profile
  • Thinking missing properties cause fallback
  • Believing multiple config files are unsupported

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes