• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

[Solved] org.hibernate.MappingException: invalid configuration

 
Ranch Hand
Posts: 430
  • 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: 430
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mapping must come after properties
 
author and cow tipper
Posts: 5000
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
 
I knew that guy would be trouble! Thanks tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic