org.hibernate.MappingException

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.

  • To reproduce: create new hsqldb database create tables (see DDL below) start eclipse create new workspace create new project create source directory import hsqldb.jar create hibernate configuration file create hibernate console (add hsqldb.jar to classpath) generate hibernate artifacts Exception dialog appears: here is <workspace>/.metadata/.log: !SESSION 2005-02-11 09:19:23.937 ----------------------------------------------- eclipse.buildId=I20041216-2000 java.version=1.4.2_06 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86 !ENTRY org.hibernate.eclipse.console.HibernateConsolePlugin 4 4 2005-02-11 09:19:23.939 !MESSAGE Error under artifact generation !STACK 0 org.hibernate.MappingException: Association references unmapped class: G1 at org.hibernate.cfg.JDBCBinder.bindCollectionSecondPass(JDBCBinder.java:1178) at org.hibernate.cfg.JDBCBinder$CollectionSecondPass.secondPass(JDBCBinder.java:1201) at org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2052) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:830) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:801) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:218) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:105) Here is DDL: create table G0 ( AN_ID VARCHAR(20), CONSTRAINT "C0" PRIMARY KEY ("AN_ID") ); create table G1 ( AN_ID VARCHAR(20), CONSTRAINT "C1" FOREIGN KEY ("AN_ID") REFERENCES "G0" ); Here is hibernate config file generated by 'generate hib. conf.' step above: <hibernate-configuration> - <session-factory> <property name="hibernate.connection.username">sa</property> <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property> <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost/t1db</property> <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property> </session-factory> </hibernate-configuration
    via by John J. Franey,
  • To reproduce: create new hsqldb database create tables (see DDL below) start eclipse create new workspace create new project create source directory import hsqldb.jar create hibernate configuration file create hibernate console (add hsqldb.jar to classpath) generate hibernate artifacts Exception dialog appears: here is <workspace>/.metadata/.log: !SESSION 2005-02-11 09:19:23.937 ----------------------------------------------- eclipse.buildId=I20041216-2000 java.version=1.4.2_06 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86 !ENTRY org.hibernate.eclipse.console.HibernateConsolePlugin 4 4 2005-02-11 09:19:23.939 !MESSAGE Error under artifact generation !STACK 0 org.hibernate.MappingException: Association references unmapped class: G1 at org.hibernate.cfg.JDBCBinder.bindCollectionSecondPass(JDBCBinder.java:1178) at org.hibernate.cfg.JDBCBinder$CollectionSecondPass.secondPass(JDBCBinder.java:1201) at org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2052) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:830) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:801) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:218) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:105) Here is DDL: create table G0 ( AN_ID VARCHAR(20), CONSTRAINT "C0" PRIMARY KEY ("AN_ID") ); create table G1 ( AN_ID VARCHAR(20), CONSTRAINT "C1" FOREIGN KEY ("AN_ID") REFERENCES "G0" ); Here is hibernate config file generated by 'generate hib. conf.' step above: <hibernate-configuration> - <session-factory> <property name="hibernate.connection.username">sa</property> <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property> <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost/t1db</property> <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property> </session-factory> </hibernate-configuration
    via by John J. Franey,
    • org.hibernate.MappingException: Association references unmapped class: G1 at org.hibernate.cfg.JDBCBinder.bindCollectionSecondPass(JDBCBinder.java:1178) at org.hibernate.cfg.JDBCBinder$CollectionSecondPass.secondPass(JDBCBinder.java:1201) at org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2052) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:830) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:801) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:218) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127) at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:105)

    Users with the same issue

    Unknown visitor2 times, last one,