aspose file tools
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

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

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

Error with XDoclet In Hibernate

suneel kota

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 name="generate"
description="Generates Hibernate class descriptor files."
<echo message="Generates Hibernate class descriptor files."/>
<!-- Define the hibernatedoclet task -->
<taskdef name="hibernatedoclet"


<fileset dir="${lib.dir}/">
<include name="*.jar"/>
<echo message="after Generates Hibernate class descriptor files."/>
<!-- Execute the hibernatedoclet task -->
<echo message="Generates Hibernate doclet."/>
<fileset dir="${src.dir}">
<include name="**/com/itc/example/business/*.java"/>

<hibernate version="3.1"/>

<!-- 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"/>
<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"/>
<path id="classpath">
<fileset dir="${lib.dir}/" includes="**/*.jar"/>
<path location="${springconf.files}"/>

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

Can anybody help me to solve this problem..

Advance thanks to all

Ranch Hand

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


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 ]
I agree. Here's the link:
subject: Error with XDoclet In Hibernate