org.hibernate.AssertionFailure

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • In JandexHelper the method {{public static <T> T getValue(AnnotationInstance annotation, String element, Class<T> type)}} calls {{annotation.value( element );}} This returns a {{Boolean}} if the annotation value is actually a {{boolean}}. The following type.cast() fails. As far as I can tell, this only affects reading the {{@Converter(autoApply)}} annotation in the current codebase. Reproduce by adding an {{@Converter}} annotated class to the persistence unit, e.g. {code} <class>org.jpwh.model.converter.MonetaryAmountConverter</class> {code} {code} [main ] ERROR - 14:01:29,37 - org.hibernate.AssertionFailure: HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: the annotation property autoApply of annotation javax.persistence.Converter is not of type boolean org.hibernate.AssertionFailure: the annotation property autoApply of annotation javax.persistence.Converter is not of type boolean at org.hibernate.metamodel.source.annotations.JandexHelper.getValue(JandexHelper.java:110) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.prepareMetadataSources(EntityManagerFactoryBuilderImpl.java:377) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:210) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:172) at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:43) at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:135) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:81) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) {code}
    via by Christian Bauer,
  • In JandexHelper the method {{public static <T> T getValue(AnnotationInstance annotation, String element, Class<T> type)}} calls {{annotation.value( element );}} This returns a {{Boolean}} if the annotation value is actually a {{boolean}}. The following type.cast() fails. As far as I can tell, this only affects reading the {{@Converter(autoApply)}} annotation in the current codebase. Reproduce by adding an {{@Converter}} annotated class to the persistence unit, e.g. {code} <class>org.jpwh.model.converter.MonetaryAmountConverter</class> {code} {code} [main ] ERROR - 14:01:29,37 - org.hibernate.AssertionFailure: HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: the annotation property autoApply of annotation javax.persistence.Converter is not of type boolean org.hibernate.AssertionFailure: the annotation property autoApply of annotation javax.persistence.Converter is not of type boolean at org.hibernate.metamodel.source.annotations.JandexHelper.getValue(JandexHelper.java:110) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.prepareMetadataSources(EntityManagerFactoryBuilderImpl.java:377) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:210) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:172) at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:43) at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:135) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:81) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) {code}
    via by Christian Bauer,
    • org.hibernate.AssertionFailure: the annotation property autoApply of annotation javax.persistence.Converter is not of type boolean at org.hibernate.metamodel.source.annotations.JandexHelper.getValue(JandexHelper.java:110) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.prepareMetadataSources(EntityManagerFactoryBuilderImpl.java:377) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:210) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:172) at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:43) at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:135) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:81) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    No Bugmate found.