Hi there,
The last couple of hours ive been breaking my head over this build error : "Schema text failed: Could not parse mapping document from file". Whatever I change to my build.xml file or classpath, the error just keeps repeating itself.
I'm using Eclipse 3.2 and MySQL db server, but never mind that... I'm sure it's my ANT build file that is wrong and I havent got the slightest clue where to look for a sollution.
It might still have something to do with the classpath. I set my classpath, including all relevant hibernate jars, through the eclipse ANT property form. Should I maybe be using the taskdef attribute 'classpathref' instead?
Hibernate version: hibernate 3
Mapping file:
<?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="Member" table="member">
<id name="id" column="id">
<generator class="increment"/>
</id>
<property name="firstName" column="firstName"/>
<property name="lastName" column="lastName"/>
</class>
</hibernate-mapping>
ANT build.xml, relevant part:
<target name="schemaexport" depends="compile"
description="Exports a generated schema to DB and file">
<echo>
Exporting schema
</echo>
<taskdef name="hibernatetool"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"/>
<hibernatetool
properties="hibernate.properties"
drop="true"
create="true"
output="mrs.sql"
text="no"
delimiter=";">
<fileset dir="bin/org/viafrica/data">
<include name="**/*.hbm.xml"/>
</fileset>
</hibernatetool>
</target>
Full stack trace of any exception that occurs:
Buildfile: D:\Java Projects\ViafricaMRS\build.xml
compile:
compress:
schemavalidate:
[schemavalidator] Feb 19, 2007 9:48:15 PM org.hibernate.cfg.Environment <clinit>
[schemavalidator] INFO: Hibernate 3.2.2
[schemavalidator] Feb 19, 2007 9:48:15 PM org.hibernate.cfg.Environment <clinit>
[schemavalidator] INFO: loaded properties from resource hibernate.properties: {hibernate.c3p0.timeout=300, hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.c3p0.max_statements=50, hibernate.c3p0.max_size=20, hibernate.dialect=org.hibernate.dialect.HSQLDialect, hibernate.c3p0.idle_test_period=3000, hibernate.format_sql=true, hibernate.c3p0.min_size=5, hibernate.connection.username=bart, hibernate.connection.url=jdbc:mysql://localhost/mrs, hibernate.show_sql=true, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.password=****}
[schemavalidator] Feb 19, 2007 9:48:15 PM org.hibernate.cfg.Environment buildBytecodeProvider
[schemavalidator] INFO: Bytecode provider name : cglib
[schemavalidator] Feb 19, 2007 9:48:15 PM org.hibernate.cfg.Environment <clinit>
[schemavalidator] INFO: using JDK 1.4 java.sql.Timestamp handling
[schemavalidator] Feb 19, 2007 9:48:16 PM org.hibernate.cfg.Configuration addFile
[schemavalidator] INFO: Reading mappings from file: D:\Java Projects\ViafricaMRS\bin\org\viafrica\data\Member.hbm.xml
[schemavalidator] Feb 19, 2007 9:48:16 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
[schemavalidator] INFO: Mapping class: Member -> member
BUILD FAILED
D:\Java Projects\ViafricaMRS\build.xml:43: Schema text failed: Could not parse mapping document from file D:\Java Projects\ViafricaMRS\bin\org\viafrica\data\Member.hbm.xml
Total time: 1 second
Thanx for any help.
|