aspose file tools*
The moose likes Spring and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Exception in thread "main" org.hibernate.MappingNotFoundException:" Watch "Exception in thread "main" org.hibernate.MappingNotFoundException:" New topic
Author

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

Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

Where did you put Userinfo.hbm.xml ?


[My Blog]
All roads lead to JavaRanch
Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
I am using netbeans 6.5. I put Useinfo.hbm.xml file in com.lak.granularity package in Source .
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3855

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) ?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
 
subject: Exception in thread "main" org.hibernate.MappingNotFoundException: