|
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.
|