-->
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.  [ 7 posts ] 
Author Message
 Post subject: Problem while running schema export ant goal
PostPosted: Tue Jun 21, 2005 2:30 am 
Beginner
Beginner

Joined: Tue Jun 21, 2005 2:21 am
Posts: 22
I'm facing problem while running schema export ant task
1) my ant target reads this ...

<target name ="schema" depends="compile">
<taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="project.class.path"/>
<schemaexport properties="${class.root}/hibernate.properties"
quiet="no" text="no" drop="no" delimiter=";">
<fileset dir="${class.root}">
<include name="**/*.hbm.xml" />
</fileset>
</schemaexport>
</target>

2) my config file reads this ...

<?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="Track" table="TRACK">
<meta atrribute ="class-descriprion">
Represent Single payable track
</meta>
<id name="id" type="int" column="TRACK_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
<property name="title" type="string" not-null="true"/>
<property name="filepath" type="string" not-null="true"/>
</class>
</hibernate-mapping>

when i try to execute ant goal from my console it says ...

BUILD FAILED
E:\Hibernate-Work\build.xml:61: taskdef class net.sf.hibernate.tool.hbm2ddl.SchemaExportTask cannot be found
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:483)

at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.ClassNotFoundException: net.sf.hibernate.tool.hbm2ddl.Schem
aExportTask
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoa
der.java:1166)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:110
7)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:977
)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457)

... 13 more
--- Nested Exception ---

my class path has
hibernate3.jar
hsqldb.jar


can any one help me in solving this problem

thanks


[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 3:15 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the documentation!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 3:19 am 
Beginner
Beginner

Joined: Tue Jun 21, 2005 2:21 am
Posts: 22
can u let me know to which document i need to look for this

-Balaji


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 3:22 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Man, just click on the "Tools" button and then on "Documentation". Is that too hard to find?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 4:45 am 
Newbie

Joined: Fri Jun 17, 2005 12:13 am
Posts: 4
your defined ant task is only user for Hibernate2,here is a example for Hibernate3:
Code:
  <target name="schema" depends="compile,xdoclet2" description="Generate DB schema from the O/R mapping files">

    <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
      <classpath refid="project.class.path" />
    </taskdef>
 
    <hibernatetool>
      <configuration configurationfile="${web-inf.dir}/classes/hibernate.cfg.xml"/>
      <hbm2ddl update="true" destdir="${data.dir}" drop="false" outputfilename="salePM.sql" />
    </hibernatetool>
  </target>

_________________
welcome to my blog:http://swallor.blogdriver.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 4:52 am 
Newbie

Joined: Fri Jun 17, 2005 12:13 am
Posts: 4
Of course you must get Hibernatetools3 at here http://www.hibernate.org/255.html

_________________
welcome to my blog:http://swallor.blogdriver.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 5:59 am 
Newbie

Joined: Tue Sep 27, 2005 5:49 am
Posts: 1
This is a great tool. But I have a problem with this guy Christians attitude!
I came across this post because I was having the same problem as Balaji and probably the same as he, thought I'd check to see on this forum if there was anything specific I was doing wrong.
It's absolutely appalling that you respond like that. Shame on you! I assume you're here with the intention of helping people? Learning a new tool on your own initiative can be an overwhelming experience to say the least!


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