File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Error in Hibernate Test Prpgram Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Error in Hibernate Test Prpgram" Watch "Error in Hibernate Test Prpgram" New topic
Author

Error in Hibernate Test Prpgram

prathamesh bandivadekar
Ranch Hand

Joined: May 22, 2008
Posts: 43
org.hibernate.InvalidMappingException: Could not parse mapping document from res
ource Employee.hbm.xml

Employee.hbm.xml

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-mapping>
<class name="com.modeln.hibernate.Employee" table="emp">

<id name="empno" column="empno">
<generator class="assigned"/>
</id>

<property name="name">
<column name="ename"/>
</property>

<property name="salary">
<column name="sal"/>
</property>

<property name="deptno">
<column name="deptno"/>
</property>

</class>
</hibernate-mapping>



hibernate.cfg.xml


<!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.connection.driver_class">
com.mysql.jdbc.Driver
</property>

<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/my_db
</property>

<property name="hibernate.connection.username">root</property>

<property name="hibernate.connection.password">root</property>

<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<property name="show_sql">true</property>


<!--Mapping Resource Description -->
<mapping resource="Employee.hbm.xml"/>


</session-factory>
</hibernate-configuration>


Can anyone suggest the problem with above two XML files?


Prathamesh M.B.<br />Java....only.....
Sundar Pari
Greenhorn

Joined: May 04, 2011
Posts: 11
Please post your project structure and stacktrace
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in Hibernate Test Prpgram
 
Similar Threads
MappingException
problem in mapping hibernate class
Strange Behavior of Hibernate - NOT RESPONDING
Session onject throwing exception when trying to save a object or begin a transaction
Dialect class not found