java.lang.IllegalArgumentException
A method rejected an argument value as invalid.
No enum constant 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 not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Java
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 13 Oct 2026