Having problems that must be related to something simple I am missing. I created a configuration file and a simple mapping file (listed below). Both were placed in the src directory immediately inside my virgin Eclipse project (called Trials). I created a console configuration that refers to these two files, and the classpath has the hsqldb.jar and /Trials/bin listed; hibernate jars have been removed. I then go to artifact creation, select the console configuration I just set up, and tell it to generate the domain code (with reverse engineering off), and I get an error indicating a mapping exception, Error reading resource: Trial.hbm.xml. The error log is shown below
It appears to me that the program is looking for an already existing Trial.class but I am trying to generate this from the mapping file, not from the database. Any assistance will be greatly appreciated.
Hibernate version: 3.05
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Trial" table="TRIAL">
<id name="id" column="TRIAL_ID">
<generator class="native"/>
</id>
<property name="dcc_number" type="int"/>
<property name="short_title"/>
<property name="long_title"/>
<property name="investigator"/>
<property name="approval_date" type="timestamp"/>
<property name="start_date" type="timestamp"/>
</class>
</hibernate-mapping>
hibernate.cfg.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="sessionFactory">
<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</property>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="show_sql">true</property>
<mapping resource="Trial.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Eclipse Directory Setup:
Trials
++++ src
hibernate.cfg.xml
Trial.hbm.xml
++++ bin
Full stack trace of any exception that occurs:
!ENTRY org.hibernate.eclipse.console.HibernateConsolePlugin 4 4 2005-06-06 07:31:21.493
!MESSAGE Error under artifact generation
!STACK 0
org.hibernate.MappingException: Could not configure datastore from file: /Users/mdean/Documents/Programming/CDMCC/RC1Workspace/Trials/src/Trial.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:245)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:163)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:226)
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:113)
Caused by: org.hibernate.MappingException: class Trial not found while looking for property: id
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:254)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
at org.hibernate.cfg.Configuration.add(Configuration.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:241)
... 6 more
Caused by: java.lang.ClassNotFoundException: Trial
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:403)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:74)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
... 14 more
!SUBENTRY 1 org.hibernate.eclipse.console.HibernateConsolePlugin 4 4 2005-06-06 07:31:21.494
!MESSAGE Could not configure datastore from file: /Users/mdean/Documents/Programming/CDMCC/RC1Workspace/Trials/src/Trial.hbm.xml
!STACK 0
org.hibernate.MappingException: Could not configure datastore from file: /Users/mdean/Documents/Programming/CDMCC/RC1Workspace/Trials/src/Trial.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:245)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:163)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:226)
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:113)
Caused by: org.hibernate.MappingException: class Trial not found while looking for property: id
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:254)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
at org.hibernate.cfg.Configuration.add(Configuration.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:241)
... 6 more
Caused by: java.lang.ClassNotFoundException: Trial
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:403)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:74)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
... 14 more
!SUBENTRY 2 org.hibernate.eclipse.console.HibernateConsolePlugin 4 150 2005-06-06 07:31:21.494
!MESSAGE Could not configure datastore from file: /Users/mdean/Documents/Programming/CDMCC/RC1Workspace/Trials/src/Trial.hbm.xml
!STACK 0
org.hibernate.MappingException: Could not configure datastore from file: /Users/mdean/Documents/Programming/CDMCC/RC1Workspace/Trials/src/Trial.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:245)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:163)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:226)
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:113)
Caused by: org.hibernate.MappingException: class Trial not found while looking for property: id
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:254)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
at org.hibernate.cfg.Configuration.add(Configuration.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:241)
... 6 more
Caused by: java.lang.ClassNotFoundException: Trial
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:403)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:74)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
... 14 more
!SUBENTRY 2 org.hibernate.eclipse.console.HibernateConsolePlugin 4 150 2005-06-06 07:31:21.495
!MESSAGE class Trial not found while looking for property: id
!STACK 0
org.hibernate.MappingException: class Trial not found while looking for property: id
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:254)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
at org.hibernate.cfg.Configuration.add(Configuration.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:241)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:163)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:226)
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:113)
Caused by: java.lang.ClassNotFoundException: Trial
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:403)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:74)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
... 14 more
!SUBENTRY 2 org.hibernate.eclipse.console.HibernateConsolePlugin 4 150 2005-06-06 07:31:21.496
!MESSAGE Trial
!STACK 0
java.lang.ClassNotFoundException: Trial
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:403)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:74)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:254)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
at org.hibernate.cfg.Configuration.add(Configuration.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:241)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:163)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:226)
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:113)
Name and version of the database you are using:
Hsqldb 1.7.3
_________________ J. Michael Dean, MD
|