I received this:
Caused by: org.xml.sax.SAXParseException: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".
Seems to have been caused because I had this in my hibernate.cfg.xml:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost</property>
<property name="hibernate.connection.username">sa</property>
<mapping class="h1.User" file="" jar="" package="" resource="User.hbm.xml"/>
<property name="hbm2ddl.auto">update</property>
</session-factory>
</hibernate-configuration>
It got fixed after I put the properties sequentially, like this:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost</property>
<property name="hibernate.connection.username">sa</property>
<property name="hbm2ddl.auto">update</property>
<mapping class="h1.User" file="" jar="" package="" resource="User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
So weird, yet true. Thanks for your post. It was helpful.
Live saver post…….. thanks a billion.