When configuring the Spring bean used to translate exceptions from JPA hierarchy to Spring DataAccessException (org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor) in the application context file running under Glassfish, when the application server starts the application, it issues a "java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation."
However, if you read the JavaDoc file for this bean, it says literally "All of Spring's applicable resource factories implement the PersistenceExceptionTranslator interface out of the box. As a consequence, all that is usually needed to enable automatic exception translation is marking all affected beans (such as DAOs) with the Repository annotation, along with defining this post-processor as bean in the application context.", what is obviously not happening.
When you run this same configuration under Tomcat (with the appropriate application context changes, considering Tomcat is not a JEE server) it works fine.
I'm attaching the server.log file for Glassfish where you can find the whole big big stack trace for this situation. Please review the last lines of server.log. Hope you may come up with the solution. Thank you in advance.