i'm trying to go from annotations to a database schema, and i'm getting an org.hibernate.MappingException.
here's my hibernate.cfg.xml
Code:
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">${hibernate.connection.url}</property>
<property name="connection.username">${hibernate.connection.username}</property>
<property name="connection.password">${hibernate.connection.password}</property>
<property name="connection.driver_class">${hibernate.connection.driver_class}</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
<property name="dialect">${hibernate.dialect}</property>
<property name="show_sql">${hibernate.show.sql}</property>
<mapping class="x.y.Application" />
<mapping class="x.y.ApplicationEvent" />
<mapping class="x.y.ApplicationProbe" />
</session-factory>
</hibernate-configuration>
my build.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="myTest" basedir=".">
<property name="lib.dir" value="../../../WebContent/WEB-INF/lib"/>
<property name="build.dir" value="build"/>
<property name="my.dir" value="/e2e/src/main/java/" />
<property name="proj.shortname" value="helloworld-jpa"/>
<!-- Classpath declaration -->
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<!-- Hibernate Tools import -->
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.classpath" classpath="${build.dir}"/>
<hibernatetool destdir="${build.dir}">
<annotationconfiguration configurationfile="hibernate.cfg.xml"/>
<hbm2ddl drop="true" create="true" export="true" outputfilename="${proj.shortname}-ddl.sql" delimiter=";"/>
<cfg2hbm/>
</hibernatetool>
</project>
when i run my build.xml, i get
Code:
Buildfile: /Users/Wong/Documents/workspace-flex/e2e/src/main/resources/build.xml
[hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration
[hibernatetool] 1. task: cfg2hbm (Generates a set of hbm.xml files)
[hibernatetool] Apr 4, 2008 11:43:41 AM org.hibernate.cfg.annotations.Version <clinit>
[hibernatetool] INFO: Hibernate Annotations 3.2.1.GA
[hibernatetool] Apr 4, 2008 11:43:41 AM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: Hibernate 3.2.2
[hibernatetool] Apr 4, 2008 11:43:41 AM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] Apr 4, 2008 11:43:41 AM org.hibernate.cfg.Environment buildBytecodeProvider
[hibernatetool] INFO: Bytecode provider name : cglib
[hibernatetool] Apr 4, 2008 11:43:41 AM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] Apr 4, 2008 11:43:41 AM org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
BUILD FAILED
/resources/build.xml:22: org.hibernate.MappingException: Unable to load class declared as <mapping class="x.y.Application"/> in the configuration:
Total time: 1 second