-->
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.  [ 4 posts ] 
Author Message
 Post subject: how do you actually do the SchemaExportTask thing?
PostPosted: Sun Jan 16, 2005 10:21 pm 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
Hibernate version: 2.1.7c

this is my mapping file
Person.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class name="onlyfun.caterpillar.User" table="USER">

<id name="id" type="string" unsaved-value="null">
<column name="user_id" sql-type="char(32)"/>
<generator class="uuid.hex"/>
</id>

<property name="name" type="string" not-null="true">
<column name="name" length="16" not-null="true"/>
</property>

<property name="sex" type="char" />

<property name="age" type="int"/>

</class>

</hibernate-mapping>

then this is my build.xml file
build.xml
<project name="Hibernate" default="schema" basedir=".">
<property name="source.root" value="src"/>
<property name="class.root" value="classes"/>
<property name="lib.dir" value="lib"/>
<property name="data.dir" value="data"/>

<path id="project.class.path">
<!-- Include our own classes, of course -->
<pathelement location="${class.root}" />
<!-- Include jars in the project library directory -->
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement path ="${classpath}"/>
</path>

<target name="schema" description="Generate DB schema from the O/R mapping files">
<!-- Teach Ant how to use Hibernate's schema generation tool -->
<taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="project.class.path"/>

<schemaexport properties="${source.root}/hibernate.properties"
quiet="no" text="no" drop="no" delimiter=";">
<fileset dir="${source.root}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
</project>

then upon typing ant, this is the error i encountered
schema
build failed
java.lang.NoClassDefFoundError: org/dom4j/Attribute at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:182)
...

what seems to be the problem?
could any one lend a help on me~

tnkx


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 16, 2005 10:39 pm 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
problem sovled
setting classpath for the libraries does not solve that problem
what i did was putting the required hibernate jars into ant's lib
then it worked...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 16, 2005 11:34 pm 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
grr... it successfully build... but it does not reflect on the database...
no table added ...
how come?
any one know why?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 17, 2005 3:30 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/ForumMailingli ... AskForHelp


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.