-->
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: net.sf.hibernate.MappingException: Error reading resource
PostPosted: Mon Dec 11, 2006 9:58 am 
Newbie

Joined: Mon Dec 11, 2006 9:43 am
Posts: 1
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.xml

Code:
<?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


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.