I have Hibernate working with the hibernate properties file and the Configuration setup like this:
Configuration cfg = new Configuration().addClass(Customer.class) -- etc.
Now I want a single mapping file for all class-table mappings. I changed the Configuration to this:
Configuration cfg = new Configuration().addFile("/com/company/app/common/hibernate/Mapping.hbm.xml")
Then I put the mapping file under classes like so: /com/company/app/common/hibernate/Mapping.hbm.xml. But I get the mapping exception below (I am using Tomcat version 5).
12:06:34,066 INFO Environment:481 - using CGLIB reflection optimizer
12:06:34,082 INFO Configuration:166 - Mapping file: com/company/app/common/hibernate/Mapping.hbm.xml
12:06:34,145 ERROR Configuration:174 - Could not configure datastore from file:
com/company/app/common/hibernate/Mapping.hbm.xml
java.net.MalformedURLException:
\com\company\app\common\hibernate\Mapping.hbm.xml
(The system cannot find the path specified)
Any ideas?
Rgds,
Jeff.
|