java.lang.IllegalArgumentException
A method rejected an argument value as invalid.
Seen on:
Java
Meaning
It’s a generic exception thrown by libraries and your own validation. The message (and the method in the stack trace) tells you which argument and why.
Common causes
- Invalid enum name in Enum.valueOf
- Null/empty values where not allowed
- Out-of-range numbers
- Spring: missing -parameters flag for @PathVariable names
⚡ Quick fix
- Read the message and the method that threw it
- Validate inputs before calling
- Use Enum lookups that handle unknown values
Detailed fix by platform
Java
- Spring Boot 3.2+: compile with
-parameters(Maven compiler plugin parameters=true) or name @RequestParam/@PathVariable explicitly
How to diagnose
- Method — Which method threw it?
- Value — Which argument value?
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026