glassfish
  1. glassfish
  2. GLASSFISH-17660

When configuring Spring exception translator (org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor) in the application context file, Glassfish issues a java.lang.IllegalStateException

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Glassfish V3.1.1 (Windows), Spring 3.0.5, Eclipselink 2.3.0 (integrated into Glassfish), IBM DB2 V8.1.18.980 (Linux), JDBC Driver type 4

      Description

      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.

        Activity

        galdunate created issue -
        shreedhar_ganapathy made changes -
        Field Original Value New Value
        Assignee shreedhar_ganapathy [ shreedhar_ganapathy ] scatari [ scatari ]

          People

          • Assignee:
            scatari
            Reporter:
            galdunate
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: