• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Solved] org.hibernate.MappingException: invalid configuration

 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Exception in thread "main" org.hibernate.MappingException: invalid configuration
Caused by: org.xml.sax.SAXParseException: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".

hibernate.cfg.xml


How can I fix this problem? Thank you!

edit: solved
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mapping must come after properties
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)


That's a direct reference to the schema, indicating the order in which various properties are expected to appear in the xml file. Follow the path, and your errors will go away.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic