Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.hibernate.InvalidMappingException: Could not parse mapping document from resource

 
Alvaro Reinoso
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I switched the mapping in my code from xml resource to annotations and got that exception. I don't see the error. I think you can figure it out from my code:

hibernate.cfg.xml



Trade.java



I will really appreciate any help.

Thanks!
 
Joseph Mokenela
Ranch Hand
Posts: 66
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please post the stack trace.
 
Alvaro Reinoso
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joseph Mokenela wrote:Can you please post the stack trace.


Problem solved:

I modified the mapping tag: <mapping class="max.Trade"/>
I also modified the SessionFactory Class

sessionFactory = new AnnotationConfiguration().configure("cfg/hibernate.cfg.xml").buildSessionFactory() -> sessionFactory = new Configuration().configure("cfg/hibernate.cfg.xml").buildSessionFactory()

I worked.

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic