Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Hibernate Test Prpgram

 
prathamesh bandivadekar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Sundar Pari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your project structure and stacktrace
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic