I am a newbie to Hibernate and using one of the tutorials.
My version of Hibernate is 3.1 and I use ant to try to generate the sql from a .hbm file (below).
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="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID">
<generator class="native"/>
</id>
<property name="date" type="timestamp" column="EVENT_DATE"/>
<property name="title"/>
</class>
</hibernate-mapping>
I use Eclipse as my IDE which, when I open this hbm file, loads/caches the dtd and does not show any errors. However when I run the ant schema export task I get the message in the subject title.The ant task is:
<target name="schema-export" description="Generate DDL from .hbm files">
<taskdef name="schema-export" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="libraries" />
<schema-export properties="hibernate.properties" quiet="no" text="no" drop="no" delimiter=";" output="schema-export.sql">
<fileset dir="${sourcedir}">
<include name="**/*.hbm.xml" />
</fileset>
</schema-export>
</target>
with the following output:
Buildfile: C:\Documents and Settings\aschulew\workspace\TestHibernate\src\build.xml
schema-export:
[schema-export] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[schema-export] log4j:WARN Please initialize the log4j system properly.
BUILD FAILED
C:\Documents and Settings\aschulew\workspace\TestHibernate\src\build.xml:58: Schema text failed: Could not read mapping document from file: C:\Documents and Settings\aschulew\workspace\TestHibernate\src\events\Event.hbm.xml
Total time: 5 seconds
Can someone please give me a pointer as to the problem ?
Thanks
|