diff --git a/spring-boot-rest/pom.xml b/spring-boot-rest/pom.xml
index 3b8cf7e39e..f05d242072 100644
--- a/spring-boot-rest/pom.xml
+++ b/spring-boot-rest/pom.xml
@@ -24,6 +24,14 @@
com.fasterxml.jackson.dataformat
jackson-dataformat-xml
+
+ org.hibernate
+ hibernate-entitymanager
+
+
+ org.springframework
+ spring-jdbc
+
org.springframework.boot
diff --git a/spring-boot-rest/src/main/java/com/baeldung/web/error/RestResponseEntityExceptionHandler.java b/spring-boot-rest/src/main/java/com/baeldung/web/error/RestResponseEntityExceptionHandler.java
index fe0465156d..2e2672f510 100644
--- a/spring-boot-rest/src/main/java/com/baeldung/web/error/RestResponseEntityExceptionHandler.java
+++ b/spring-boot-rest/src/main/java/com/baeldung/web/error/RestResponseEntityExceptionHandler.java
@@ -1,5 +1,11 @@
package com.baeldung.web.error;
+import javax.persistence.EntityNotFoundException;
+
+import org.hibernate.exception.ConstraintViolationException;
+import org.springframework.dao.DataAccessException;
+import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -10,8 +16,6 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
-import com.baeldung.web.exception.MyDataAccessException;
-import com.baeldung.web.exception.MyDataIntegrityViolationException;
import com.baeldung.web.exception.MyResourceNotFoundException;
@ControllerAdvice
@@ -24,13 +28,15 @@ public class RestResponseEntityExceptionHandler extends ResponseEntityExceptionH
// API
// 400
- /*
- * Some examples of exceptions that we could retrieve as 400 (BAD_REQUEST) responses:
- * Hibernate's ConstraintViolationException
- * Spring's DataIntegrityViolationException
- */
- @ExceptionHandler({ MyDataIntegrityViolationException.class })
- public ResponseEntity