This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Error with XDoclet In Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Error with XDoclet In Hibernate" Watch "Error with XDoclet In Hibernate" New topic
Author

Error with XDoclet In Hibernate

suneel kota
Greenhorn

Joined: Jun 06, 2006
Posts: 24
Dear All,


I am getting error while i am generating .hbm.xml files using XDoclet.

This is the error i am getting

D:\suneel\databasework\LoginApp\WEB-INF\build.xml:41: Couldn't find the class xdoclet.modules.web.WebDocletTask on the classpath:

My build.xml file is


<project name="loginapp" basedir="." default="main">

<property name="src.dir" value="src"/>
<property name="springconf.files" value="src"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="lib.dir" value="lib/xdoclet"/>
<property name="generated.home" value="generated.home"/>

<target name="compile" description="Generates class files">
<echo message="builiding classes"/>
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
</target>



<target name="generate"
description="Generates Hibernate class descriptor files."
depends="compile">
<echo message="Generates Hibernate class descriptor files."/>
<!-- Define the hibernatedoclet task -->
<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask">

<classpath>

<fileset dir="${lib.dir}/">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<echo message="after Generates Hibernate class descriptor files."/>
<!-- Execute the hibernatedoclet task -->
<hibernatedoclet
destdir="${generated.home}"
excludedtags="@version,@author,@todo"
force="${generate.forced}"
mergedir="${generated.home}">
<echo message="Generates Hibernate doclet."/>
<fileset dir="${src.dir}">
<include name="**/com/itc/example/business/*.java"/>
</fileset>

<hibernate version="3.1"/>
</hibernatedoclet>

<!-- Upgrade grammar from Hibernate1 to Hibernate2 - not needed if you are using the <hibernate version="2.0"/> tag -->
<replace dir="${generated.home}" echo="building xml">

<include name="**/hibernate/*.hbm.xml"/>
<replacefilter token="readonly=" value="inverse="/>
<replacefilter token="role=" value="name="/>
<replacefilter token="hibernate-mapping.dtd" value="hibernate-mapping-2.0.dtd"/>
</replace>
<target name="file-list"
description="Create hibernate mapping file list">
<property name="generated.dir" location="target/classes"/>
<property name="hibernate.list.file" location="hbnfiles.xml"/>
<script language="beanshell" src="create_hbnfiles.bsh"/>
</target>
</target>
<path id="classpath">
<fileset dir="${lib.dir}/" includes="**/*.jar"/>
<path location="${springconf.files}"/>
</path>


<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="main" depends="generate"/>
</project>


Can anybody help me to solve this problem..


Advance thanks to all

Regards
SuneelKota
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
i think it a ant problem your classpath is wrong


try




but be sure that xdoclet file are well placed there
<property name="lib.dir" value="${base}/lib/xdoclet"/>
[ July 07, 2006: Message edited by: Benjamin Leonard ]
 
GeeCON Prague 2014
 
subject: Error with XDoclet In Hibernate