Spring Exception Handling

exceptions-notes

[Solved] CommandAcceptanceException: Error executing DDL

1. Problem When writing tests that depend on H2 database in a Spring boot application, we may encounter the CommandAcceptanceException: Error executing DDL. The root cause exception will be org.h2.jdbc.JdbcSQLSyntaxErrorException in the logs. The exception stack trace will look something like this: If you are trying to run unit tests with the H2 database and …

Spring ProblemDetail and ErrorResponse

Starting since Spring 6 and Spring Boot 3, the Spring Framework supports the “Problem Details for HTTP APIs” specification, RFC 7807. This Spring tutorial will guide you through this new enhancement in detail. 1. Problem Details Specification [RFC 7807] This RFC defines simple JSON and XML document formats that can …

Spring SimpleMappingExceptionResolver Example

In some badly coded applications, when an unknown exception occurs the application server usually displays the evil exception stack trace to the user in the webpage itself. In this case, users have nothing to do with this stack trace and complain that your application is not user-friendly. Moreover, it can …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.