Hi all,
I am getting the following error while running my program. I am using Tomcat 4.1 with MySQL5.0
Exception:net.sf.hibernate.MappingException: Error reading resource: net/sf/hibe
rnate/examples/quickstart/Cat.hbm.xml
I am using the hibernate version 2.0
I am giving my configuration files:
hibernate.cfg.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/quickstart</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">admin</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<!-- Mapping files -->
<mapping resource="net/sf/hibernate/examples/quickstart/Cat.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Cat.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="net.sf.hibernate.examples.quickstart.Cat" table="CAT">
<id name="id" type="string" unsaved-value="null" >
<column name="CAT_ID" sql-type="varchar(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name">
<column name="NAME" not-null="true"/>
</property>
<property name="sex"/>
<property name="weight"/>
</class>
</hibernate-mapping>
I placed hibernate.cfg.xml in C:\Tomcat4.1\webapps\quickstart\WEB-INF\classes and cat.hbm.xml in C:\Tomcat4.1\webapps\quickstart\WEB-INF\classes\net\sf\hibernate\examples\quickstart.
Can anyone help me on this?
Thanks
Sekhar