• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error: could not locate mapping file

 
Yaseen Khan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using hinernate3 and trying to execute a sample stand alone program. I put the following files in the same directory.
Test.java //testing program
CD.java //object to be persisted
CD.hbm.xml //object mapping file
hibernate.cfg.xml //hibernate configuration file

Test class is compiling well. But when I try to run the same class, it is showing following error

Exception in thread "main" org.hibernate.HibernateException: Could not parse configuration: CD.hbm.xml at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1325)

Thanks for ur reply in advance.
Yaseen
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is CD.hbm.xml on the classpath? Is CD.hbm.xml valid XML?
 
Magesh Lakshmi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simplest way is to keep the hbm file along with the java file in the same package. Tyr it out.
 
Harathi Rao
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When it couldnot parse any config or mapping file.. It might be you are using old DTD. change it to new one and try now...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic