Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in thread "main" org.hibernate.MappingNotFoundException:

 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to spring and hibernate. I am getting following error while i am trying to run my application.


error:

INFO: Reading mappings from resource : com/lak/granularity/Userinfo.hbm.xml
Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com/lak/granularity/Userinfo.hbm.xml not found



hibernate.hbm.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/mysql</property>
<property name="hibernate.connection.username">root</property>
<property name="hbm2ddl.auto">create</property>
<mapping resource="com/lak/granularity/Userinfo.hbm.xml"/>
</session-factory>
</hibernate-configuration>



Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you put Userinfo.hbm.xml ?
 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using netbeans 6.5. I put Useinfo.hbm.xml file in com.lak.granularity package in Source .
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhaskar Gara wrote:I am using netbeans 6.5. I put Useinfo.hbm.xml file in com.lak.granularity package in Source .


So, is it copied/deployed in the server in the correct place (com/lak/granularity/Userinfo.hbm.xml) ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic