-->
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.  [ 1 post ] 
Author Message
 Post subject: HibernateToolTask - Cannot find Mapping Resource
PostPosted: Wed Oct 21, 2009 7:52 am 
Newbie

Joined: Wed Oct 21, 2009 7:33 am
Posts: 11
I've been working for several hours in trying to make my build work. I'm basically exporting a sql file import.sql using HibernateToolTask with the target schema-drop as shown below from my build file. My import.sql file is located on the same folder as the hibernate.cfg.xml.

<?xml version="1.0" encoding="UTF-8"?>
<project name="LDS BANKING" basedir="." default="build">

<property name="hibernate.cfg.dir" value="${basedir}/config/hibernate/test"/>
<property environment="env"/>

<target name="compile">

</target>

<target name="build">
</target>


<path id="toolslib">
<path location="${basedir}/lib/hibernate//hibernate-tools.jar" />
<path location="${basedir}/lib/hibernate/hibernate3.jar" />
<path location="${basedir}/lib/hibernate/hibernate-annotations.jar" />
<path location="${basedir}/lib/freemarker.jar" />
<path location="${basedir}/lib/jtds-1.2.4.jar" />
<path location="${basedir}/lib/log4j-1.2.15.jar"/>
<path location="${basedir}/lib/hibernate/dom4j-1.6.1.jar"/>
<path location="${basedir}/lib/hibernate/slf4j-api-1.5.8.jar"/>
<path location="${basedir}/lib/hibernate/slf4j-log4j12-1.5.8.jar"/>
<path location="${basedir}/lib/xercesImpl-2.6.2.jar"/>
<path location="${basedir}/src/com/lds/training/persistence/hibernate/model/account/"/>
</path>

<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib" />

<target name="schema-drop" depends="compile">
<hibernatetool destdir="${basedir}/build/generated">
<classpath location="toolslib"/>
<configuration configurationfile="${hibernate.cfg.dir}/hibernate.cfg.xml"/>
<hbm2ddl drop="true" create="false" export="true" update="false"/>
</hibernatetool>
</target>
<target name="schema-recreate" depends="compile">
<hibernatetool destdir="${basedir}/build/generated">
<classpath location="toolslib"/>
<configuration configurationfile="${hibernate.cfg.dir}/hibernate.cfg.xml"/>
<hbm2ddl drop="true" create="true" export="true" update="false"/>
</hibernatetool>
</target>

<target name="schema-docu" depends="compile" description="Generate a html description of the mappings">
<hibernatetool destdir="${basedir}/build/generated/html">
<classpath location="toolslib"/>
<configuration configurationfile="${hibernate.cfg.dir}/hibernate.cfg.xml"/>
<hbm2doc/>
</hibernatetool>
</target>

</project>

When I run this it always throws this error

[hibernatetool] A resource located at com/lds/training/persistence/hibernate/model/account/Account.hbm.xml was not found.
[hibernatetool] Check the following:
[hibernatetool]
[hibernatetool] 1) Is the spelling/casing correct ?
[hibernatetool] 2) Is com/lds/training/persistence/hibernate/model/account/Account.hbm.xml available via the classpath ?
[hibernatetool] 3) Does it actually exist ?

BUILD FAILED
C:\Personal\projects\training\com.lds.training.persistence\build.xml:34: org.hibernate.MappingNotFoundException: resource: com/lds/training/persistence/hibernate/model/account/Account.hbm.xml not found
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226)

And this is my mapping configuration
<mapping resource="com/lds/training/persistence/hibernate/model/account/Account.hbm.xml"/>
<mapping resource="com/lds/training/persistence/hibernate/model/account/Card.hbm.xml"/>
<mapping resource="com/lds/training/persistence/hibernate/model/account/Debit.hbm.xml"/>
<mapping resource="com/lds/training/persistence/hibernate/model/account/Deposit.hbm.xml"/>

I'm not sure what the issue is. Would appreciate any help.

Thanks.

rcg


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.