org.hibernate.AssertionFailure: Table C not found

Hibernate JIRA | André J. Rogger | 1 decade ago
  1. 0

    I have created a JPA orm mapping file for an entity hierarchy using the JOINED inheritance strategy. In the mapping file, I specify the default schema like this: {{ <entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd" version="2.1"> <schema>fim</schema> ...... }} Everything works fine until I migrate to Hibernate higher than 5.0.1, up to 5.0.7 which is bundled in Wildfly 10 at the moment. When deploy the application to Wildfly 10, I got the following error: {quote} 13:58:04,770 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 164) MSC000001: Failed to start service jboss.persistenceunit."fim-manager-webapp-1.0-SNAPSHOT.war#FimPu-jta-mysql": org.jboss.msc.service.StartException in service jboss.persistenceunit."fim-manager-webapp-1.0-SNAPSHOT.war#FimPu-jta-mysql": javax.persistence.PersistenceException: [PersistenceUnit: FimPu-jta-mysql] Unable to build Hibernate SessionFactory at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: javax.persistence.PersistenceException: [PersistenceUnit: FimPu-jta-mysql] Unable to build Hibernate SessionFactory at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) ... 7 more Caused by: org.hibernate.MappingException: Could not instantiate persister org.hibernate.persister.entity.JoinedSubclassEntityPersister at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:112) at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:346) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) ... 9 more Caused by: org.hibernate.AssertionFailure: Table fim.ASC_FEED_ENTRY not found at org.hibernate.persister.entity.AbstractEntityPersister.getTableId(AbstractEntityPersister.java:5107) at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:433) at sun.reflect.GeneratedConstructorAccessor89.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96) ... 13 more {quote} The workaround is removing <schema> elements for these entities in the inheritance hierarchy from the mapping file. For other entities, they work fine with or without <schema>.

    Hibernate JIRA | 10 months ago | Roger Suen
    javax.persistence.PersistenceException: [PersistenceUnit: FimPu-jta-mysql] Unable to build Hibernate SessionFactory
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    I am trying to create bidirectional association between two entities in which one can be Inherited and it fails with table not found: 11:37:39,229 ERROR [AssertionFailure] [] 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: Table CRM.CRM_AKTIVNOST_DOGODKI not found at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:480) at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:259) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:87) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246) The code looks like this: @Entity @Table(name = "CRM_AKTIVNOST") public class Aktivnost implements Serializable { private List<Dogodek> dogodki; .... .... @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL,mappedBy = "aktivnost") public List<Dogodek> getDogodki() { return dogodki; } public void setDogodki(List<Dogodek> dogodki) { this.dogodki = dogodki; } ... ... } @Entity @Table(name = "CRM_DOGODEK") @Inheritance(strategy= InheritanceType.JOINED) public class Dogodek implements Serializable { ... ... private Aktivnost aktivnost; .... .... @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinTable(name = "CRM_AKTIVNOST_DOGODKI", joinColumns = {@JoinColumn(name = "DOGODEK_ID")}, inverseJoinColumns = {@JoinColumn(name = "AKTIVNOST_ID")}) public Aktivnost getAktivnost() { return aktivnost; } public void setAktivnost(Aktivnost aktivnost) { this.aktivnost = aktivnost; } ... }

    Hibernate JIRA | 8 years ago | Tomaz Cerar
    org.hibernate.AssertionFailure: Table CRM.CRM_AKTIVNOST_DOGODKI not found
  4. 0

    I have encountered the issue for creating a many to one relation ship. could you please check below error . This is same bug like ANN-376 http://opensource.atlassian.com/projects/hibernate/browse/ANN-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel In this error the status is duplicate, but no one mention where it was solved. fe use of the session) [java] org.hibernate.AssertionFailure: Table XXXXXXXXXXX not found [java] at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:458) [java] at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:237) [java] at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58) [java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) [java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) [java] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713) [java] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121) [java] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51) [java] at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:458) [java] at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:237) [java] at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58) [java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) [java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) [java] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713) [java] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121) [java] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51) [java] at co It is creating a table. There was no problem with creating a table or connection

    Hibernate JIRA | 8 years ago | SATISH K R YERUVA
    org.hibernate.AssertionFailure: Table XXXXXXXXXXX not found

    1 unregistered visitors
    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

      Table C not found

      at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId()
    2. Hibernate
      JoinedSubclassEntityPersister.<init>
      1. org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:444)
      2. org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:225)
      2 frames
    3. Hibernate
      PersisterFactory.createClassPersister
      1. org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
      1 frame