Bird
0
0

You set server.port=8080 in application.properties and also pass --server.port=9090 as a command line argument, but the app still runs on port 8080. What is the most likely cause?

medium📝 Debug Q14 of 15
Spring Boot - Application Configuration
You set server.port=8080 in application.properties and also pass --server.port=9090 as a command line argument, but the app still runs on port 8080. What is the most likely cause?
Aapplication.properties has higher priority
BSpring Boot ignores command line arguments by default
CEnvironment variable overrides command line
DCommand line argument syntax is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Understand expected behavior

    Command line arguments should override properties file settings.
  2. Step 2: Identify why command line arg might be ignored

    If the syntax is wrong (e.g., missing dashes or wrong format), Spring Boot won't apply it.
  3. Final Answer:

    Command line argument syntax is incorrect -> Option D
  4. Quick Check:

    Incorrect syntax means command line ignored [OK]
Quick Trick: Check command line argument format carefully [OK]
Common Mistakes:
  • Assuming properties file always overrides command line
  • Thinking environment variables override command line
  • Believing Spring Boot ignores command line args by default

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes