
Fix UnsupportedOperationException on Immutable Lists
Why List.of, Arrays.asList and Stream.toList reject changes with UnsupportedOperationException, and how to get a list you can modify.
Tag
77 posts

Why List.of, Arrays.asList and Stream.toList reject changes with UnsupportedOperationException, and how to get a list you can modify.

Fix the Whitelabel Error Page in Spring Boot by checking component scanning, the mapped path, the context path and the template location.

Fix the Spring Boot DataSource startup failure by checking the URL, the driver, the active profile and whether the application should have a database at all.

Fix the Spring error about an unresolvable placeholder by checking the property name, the active profile, test resources and environment variable names.

Find why a Spring Boot test cannot load its ApplicationContext, from a missing configuration class to a missing bean, property or database.

Fix a Spring Boot container that exits at once by reading its logs and checking the Java version, jar path, architecture, configuration and memory limit.

Find the process holding port 8080 on macOS, Linux and Windows, stop it, or move Spring Boot to another port, and fix the tests that collide.

Read the failure analysis Spring Boot prints, classify the cause in a minute and use the condition report when no analyzer matches.

Break the circular dependency Spring Boot refuses to start with by extracting a third bean, publishing an event or, as a last resort, using lazy injection.

Handle validation failures in Spring MVC by turning MethodArgumentNotValidException and HandlerMethodValidationException into one clear error response.

Fix the 400 error for a missing request parameter in Spring MVC with optional parameters, defaults, correct parameter names and the right annotation.

Fix the 400 Bad Request caused by a request body Spring MVC cannot read, from an empty body to a wrong type, a bad enum or malformed JSON.