Uploaded image for project: 'Hibernate ORM'
  1. HHH-10047

java.lang.ClassCastException: org.hibernate.id.MultipleHiLoPerTableGenerator cannot be cast to org.hibernate.id.IdentifierGenerator when deploying to glassfish 4.1 since 4.3.6

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Suitable for new contributors:
      Yes, likely
    • Last commented by a user?:
      true

      Description

      We have a JSF app that uses JPA and Hibernate which is deployed on Glassfish 4.1. It was ok when we used Hibernate 4.3.5. After upgrading to 4.3.6, it started to throw the exception during deployment:

      java.lang.ClassCastException: org.hibernate.id.MultipleHiLoPerTableGenerator cannot be cast to org.hibernate.id.IdentifierGenerator
      at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:115)

      This happened for every release >= 4.3.6 (we even tried 5.0). We tried to debug into the code above usng the Netbeans environment and found that at line 115 of class DefaultIdentifierGeneratorFactory, the instance returned by clazz.newInstance() is indeed org.hibernate.id.MultipleHiLoPerTableGenerator and it is definitely a subclass of IdentifierGenerator:

      IdentifierGenerator identifierGenerator = ( IdentifierGenerator ) clazz.newInstance();

      We also tried to run it deploy it on GF 4.1 on another machine but the result is still the same. Attached is the source and the pom file, which is currently using Hibernate 4.3.6.

        Attachments

        1. pom.xml
          4 kB
        2. src.zip
          14 kB

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: