This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Error in Hibernate Test Prpgram

 
Ranch Hand
Posts: 45
  • 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?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your project structure and stacktrace
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic