Hi,
I'm a relatively new Hibernate user looking to use hbm2java within ant for a webapp I am developing. I'm using the latest released hibernate-tools.jar, but the tool cannot find my .hbm.xml files, which I've placed in the "project_root/src/org/marketcharts/data/" directory and am pointing to from the hibernate.cfg.xml file in my src/ directory:
<mapping resource="org/marketcharts/data/Ticker.hbm.xml"/>
<mapping resource="org/marketcharts/data/HistoricalQuote.hbm.xml"/>
The error I am receiving is as follows:
bmccann@chameleon:~/Documents/Programs/marketTracker> ant codegen
Buildfile: build.xml
codegen:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
BUILD FAILED
/home/bmccann/Documents/Programs/marketTracker/build.xml:227: org.hibernate.MappingException: Resource: org/marketcharts/data/Ticker.hbm.xml not found
Here is the releveant excerpt from my build.xml file which resides in the project root directory:
<!-- Load Hibernate's code generation tool -->
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="project.classpath"/>
<!-- Generate the java code for all mapping files in our source tree -->
<target name="codegen"
description="Generate Java source from the O/R mapping files">
<hibernatetool destdir="${src.home}">
<classpath refid="project.classpath"/>
<configuration configurationfile="${src.home}/hibernate.cfg.xml" />
<hbm2java />
</hibernatetool>
</target>
Any ideas or help you could give me would be much appreciated.
Thanks,
Ben
|