-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: schema export fails with MappingException
PostPosted: Tue Jun 08, 2004 6:28 pm 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
I'm having trouble setting up hibernate to work with my program.
It's a stand-alone java application that accesses a postgresql database (previously through Torque, and I'm now trying to refactor it to use hibernate instead).

I used the xdoclet hibernate task to create the .hbm.xml files, but when I try to generate the schema, it fails saying it can't find the class files.
I've checked my classpath over and over, and have tried multiple ways of specifying it but still nothing.

The xdoclet task is defined like this:

<target name="db-xdoclet" depends="prepare" description="Generates Hibernate class descriptor files.">
<taskdef classname="xdoclet.modules.hibernate.HibernateDocletTask"
classpathref="path.self" name="hibernatedoclet"
/>
<hibernatedoclet
destdir="${dir.work.build}"
excludedtags="@version,@author,@todo"
force="true"
verbose="true"
mergedir="${dir.work.build}"
>
<fileset dir="${dir.src.java}">
<include name="**/*.java"/>
</fileset>
<hibernate version="2.0"/>
</hibernatedoclet>
</target>

It generates the .hbm.xml files fine. However when I run this task:

<target name="db-schema" depends="prepare">
<taskdef classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
name="schemaexport" classpathref="path.self"/>
<schemaexport delimiter=";" drop="false" output="${dir.work.sql}/schema.sql"
properties="${dir.work.conf}/hibernate.properties" quiet="false" text="false">
<fileset dir="${dir.work.build}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>

It fails:
[schemaexport] 2004-06-08 21:15:32,718 [main] ERROR net.sf.hibernate.cfg.Configuration - Could not compile the mapping document
[schemaexport] net.sf.hibernate.MappingException: persistent class [org.blah.data.BackupFile] not found

The classpath path.self is defined as follows:

<path id="path.self">
<fileset dir="${dir.lib}" >
<include name="**/*.jar" />
</fileset>
<fileset dir="${dir.build.lib}" >
<include name="**/*.jar" />
</fileset>
<pathelement path="${dir.src.java}"/>
<pathelement path="${dir.work.java}"/>
</path>

It's the same path I use for the javac task, which works perfectly.

Is there something I'm missing? This is with Hibernate 2.1.4 btw.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 11:27 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
dir.work.java is where you put .class ?

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.