I'm completely stumped trying to figure out the proper place to put a hibernate mapping configuration file for my struts app.
I'm using the eclipse webtools. It gives me a directory layout like this:
./build:
./src:
./src/com/schumeyer/library
contains all java source files, as well as all *.hbm.cfg files
./Web:
./Web/WEB-INF
classes
hibernate.cfg.xml
MessageResources.properties
lib
many jar files
src
nothing here
struts-config.xml
tiles-defs.xml
validation.xml
web.xml
I keep getting the following exception:
org.hibernate.MappingNotFoundException: resource: classes/com/schumeyer/library/Customer.hbm.xml not found
PLEASE help with these questions:
1) Do I need to change my directory layout, or is the above layout ok?
2) Where do I put the *.hbm.cfg files ?
3) What do I put in the mapping resource element?
Hibernate version: 3.2
Mapping documents:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">jdbc:postgresql:lib2</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.username">rick</property>
<property name="hibernate.connection.password">rick</property>
<property name="hibernate.connection.pool_size">0</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<!-- You will usually want to set this to true while debugging Hibernate queries -->
<property name="hibernate.show_sql">true</property>
<!-- "Import" the mapping resources here -->
<mapping resource="classes/com/schumeyer/library/Customer.hbm.xml"/>
</session-factory>
</hibernate-configuration>
[