@@ -0,0 +1,1246 @@
+package at.ac.tuwien.inso.controller;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.MessageSource;%0Aimport org.springframework.context.i18n.LocaleContextHolder;%0Aimport org.springframework.dao.DataAccessException;%0Aimport org.springframework.web.bind.annotation.ControllerAdvice;%0Aimport org.springframework.web.bind.annotation.ExceptionHandler;%0Aimport org.springframework.web.servlet.ModelAndView;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0A%0A@ControllerAdvice%0Apublic class GlobalExceptionHandler %7B%0A%0A    private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);%0A%0A    @Autowired%0A    private MessageSource messageSource;%0A%0A    @ExceptionHandler(DataAccessException.class)%0A    public ModelAndView handleDataAccessExceptions(HttpServletRequest request, DataAccessException ex) %7B%0A        logger.info(%22DataAccessException: %22 + ex.getMessage() + %22%5Cn url=%22+request.getRequestURL());%0A        ModelAndView mav = new ModelAndView();%0A        mav.addObject(%22message%22, messageSource.getMessage(%22error.dataaccess%22, null, LocaleContextHolder.getLocale()));%0A        mav.setViewName(%22error%22);%0A        return mav;%0A    %7D%0A%7D%0A

add global exception handler class, including a handler for all jpa related exceptions.