org.hibernate.AssertionFailure: Unknown type Java type: int[]

Hibernate JIRA | Stephen Friedrich | 1 decade ago
  1. 0

    This simple entity breaks hibernate: {code}@Entity public class Foo { @Id @GeneratedValue private Long _id; private int[] getWorkingHoursPerWeek(Set<Date> holidayDays) { return null; } } {code} This is the error message: Exception in thread "main" org.hibernate.AssertionFailure: Unknown type Java type: int[] at org.hibernate.cfg.PropertyInferredData.extractType(PropertyInferredData.java:233) at org.hibernate.cfg.PropertyInferredData.execute(PropertyInferredData.java:124) at org.hibernate.cfg.PropertyInferredData.skip(PropertyInferredData.java:60) at org.hibernate.cfg.AnnotationBinder.addAnnotatedElement(AnnotationBinder.java:900) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:868) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:717) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:547) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210) at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:647) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:96) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64) at com.fortis.texas.server.tools.GenerateDbSchema.main(GenerateDbSchema.java:27) Seems hibernate wants to parse the method (even though its completely unrelated to persistence) and then cannot deal with the int[] return type. I can workaround this by renaming the method to "calculateWorkingHoursPerWeek". Funny error. Actually I am using JBoss 4.0.4RC1 (which I think is hibernate 3.1. 2 and annotations 3.1.beta8).

    Hibernate JIRA | 1 decade ago | Stephen Friedrich
    org.hibernate.AssertionFailure: Unknown type Java type: int[]
  2. 0

    This simple entity breaks hibernate: {code}@Entity public class Foo { @Id @GeneratedValue private Long _id; private int[] getWorkingHoursPerWeek(Set<Date> holidayDays) { return null; } } {code} This is the error message: Exception in thread "main" org.hibernate.AssertionFailure: Unknown type Java type: int[] at org.hibernate.cfg.PropertyInferredData.extractType(PropertyInferredData.java:233) at org.hibernate.cfg.PropertyInferredData.execute(PropertyInferredData.java:124) at org.hibernate.cfg.PropertyInferredData.skip(PropertyInferredData.java:60) at org.hibernate.cfg.AnnotationBinder.addAnnotatedElement(AnnotationBinder.java:900) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:868) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:717) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:547) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210) at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:647) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:96) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64) at com.fortis.texas.server.tools.GenerateDbSchema.main(GenerateDbSchema.java:27) Seems hibernate wants to parse the method (even though its completely unrelated to persistence) and then cannot deal with the int[] return type. I can workaround this by renaming the method to "calculateWorkingHoursPerWeek". Funny error. Actually I am using JBoss 4.0.4RC1 (which I think is hibernate 3.1. 2 and annotations 3.1.beta8).

    Hibernate JIRA | 1 decade ago | Stephen Friedrich
    org.hibernate.AssertionFailure: Unknown type Java type: int[]
  3. 0

    I get this error when trying to full join: - 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: undefined join type 23 at org.hibernate.hql.ast.util.JoinProcessor.toHibernateJoinType(JoinProcessor.java:68) at org.hibernate.hql.ast.HqlSqlWalker.setImpliedJoinType(HqlSqlWalker.java:433) at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3157) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3067) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623) at com.finantix.test.Main.main(Main.java:63)

    Hibernate JIRA | 9 years ago | Fabio Tudone
    org.hibernate.AssertionFailure: undefined join type 23
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I get this error when trying to full join: - 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: undefined join type 23 at org.hibernate.hql.ast.util.JoinProcessor.toHibernateJoinType(JoinProcessor.java:68) at org.hibernate.hql.ast.HqlSqlWalker.setImpliedJoinType(HqlSqlWalker.java:433) at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3157) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3067) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623) at com.finantix.test.Main.main(Main.java:63)

    Hibernate JIRA | 9 years ago | Fabio Tudone
    org.hibernate.AssertionFailure: undefined join type 23
  6. 0

    My code works fine with 3.1b6. I just tried upgrading to 3.1b7 today and got this exception: Unable to extract type of property writableVersion: VersionType org.hibernate.AssertionFailure: Unable to extract type of property writableVersion: VersionType at org.hibernate.cfg.PropertyInferredData.extractType(PropertyInferredData.java:222) at org.hibernate.cfg.PropertyInferredData.execute(PropertyInferredData.java:114) at org.hibernate.cfg.PropertyInferredData.skip(PropertyInferredData.java:57) at org.hibernate.cfg.AnnotationBinder.addAnnotatedElement(AnnotationBinder.java:831) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:808) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:641) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:266) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:199) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1146) Here are the relevant excerpts from my source code: @EmbeddableSuperclass public abstract class VersionedObject<ThisType extends VersionedObject, VersionType extends Version<ThisType>> { ... @Transient public VersionType getWritableVersion() { ... @EmbeddableSuperclass public abstract class Version<ContinuityType extends VersionedObject> { ... Since the writableVersion property is marked as Transient, shouldn't the AnnotationBinder just be ignoring it?

    Hibernate JIRA | 1 decade ago | Tim McCune
    org.hibernate.AssertionFailure: Unable to extract type of property writableVersion: VersionType

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.AssertionFailure

      Unknown type Java type: int[]

      at org.hibernate.cfg.PropertyInferredData.extractType()
    2. Hibernate
      SchemaExport.<init>
      1. org.hibernate.cfg.PropertyInferredData.extractType(PropertyInferredData.java:233)
      2. org.hibernate.cfg.PropertyInferredData.execute(PropertyInferredData.java:124)
      3. org.hibernate.cfg.PropertyInferredData.skip(PropertyInferredData.java:60)
      4. org.hibernate.cfg.AnnotationBinder.addAnnotatedElement(AnnotationBinder.java:900)
      5. org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:868)
      6. org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:717)
      7. org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:547)
      8. org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276)
      9. org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210)
      10. org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:647)
      11. org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:96)
      12. org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64)
      12 frames
    3. com.fortis.texas
      GenerateDbSchema.main
      1. com.fortis.texas.server.tools.GenerateDbSchema.main(GenerateDbSchema.java:27)
      1 frame