Note that there are some explanatory texts on larger screens.

plurals
  1. POHibernate error with session factory
    text
    copied!<p>I have got this <code>hibernate.cfg.xml</code>:</p> <pre><code> &lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; &lt;hibernate-configuration&gt; &lt;session-factory&gt; &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt; &lt;mapping class="iger.User"/&gt; &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt; &lt;property name="connection.url"&gt;jdbc:mysql://localhost/MyAppBase&lt;/property&gt; &lt;property name="connection.username"&gt;root&lt;/property&gt; &lt;property name="connection.password"&gt;root&lt;/property&gt; &lt;property name="hibernate.hbm2ddl.auto"&gt; create &lt;/property&gt; &lt;property name="transaction.factory_class"&gt;org.hibernate.transaction.JDBCTransactionFactory&lt;/property&gt; &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt; &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt; &lt;/session-factory&gt; &lt; /hibernate-configuration&gt; </code></pre> <p>this is where i try to create a session</p> <pre><code>SessionFactory factory= new Configuration().configure("iger/hibernate.cfg.xml").buildSessionFactory(); Session session = factory.openSession(); session.beginTransaction(); session.save(regUser); session.getTransaction().commit(); </code></pre> <p>and this i what i get </p> <blockquote> <p>Last cause: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)<em>,event</em>,listener*)".</p> </blockquote> <p>Why is that? What's wrong? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload