
Fix HttpMediaTypeNotSupportedException in a Spring MVC App
Fix the 415 Unsupported Media Type error by sending the right Content-Type header, matching the consumes attribute and checking the message converters.
Tag
77 posts

Fix the 415 Unsupported Media Type error by sending the right Content-Type header, matching the consumes attribute and checking the message converters.

Fix a 405 Method Not Allowed from a Spring MVC endpoint by matching the HTTP verb, the path and redirects that turn a POST into a GET.

Fix CORS errors from a browser calling a Spring Boot API by configuring allowed origins, methods and credentials, with and without Spring Security.

Detect the Hibernate N plus 1 query problem with a statement count, then remove it with a fetch join, an entity graph or batch fetching.

Fix Quarkus build failures about unsatisfied or ambiguous CDI dependencies, including unused beans that were removed and libraries missing an index.

Fix a Quarkus native executable that builds and then fails at runtime with missing classes or methods, by registering classes for reflection correctly.

Fix a Maven or Gradle build that reports zero tests by checking the Surefire version, test class names, imports and the JUnit Platform setting.

Fix the JUnit "No runnable methods" and initializationError failures caused by mixing JUnit 4 and JUnit 5 annotations or a wrongly configured runner.

Fix the Testcontainers error about a missing Docker environment by starting the daemon, pointing at the right socket and updating an old client.

Fix a Vaadin app that shows a blank page after deployment by building with the production profile and checking the packaged frontend bundle.

Fix the Faces error where an expression cannot reach its target: check the bean name, scope imports, CDI discovery and nulls in the path.

Tell ClassNotFoundException from NoClassDefFoundError, then find the missing jar, the wrong scope or the failed static initializer behind each.