title: "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)"
body: <p>I can't find what's wrong with my hibernate.cfg.xml file.</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;!--  Database connection settings 
    --&gt; 
    &lt;property name="connection.driver_class"&gt;org.h2.Driver&lt;/property&gt; 
    &lt;property name="connection.url"&gt;jdbc:h2://localhost:1527/hibernatedb&lt;/property&gt; 
    &lt;property name="connection.username"&gt;h2&lt;/property&gt; 
    &lt;property name="connection.password" /&gt; 
  - &lt;!--  JDBC connection pool (use the built-in) 
    --&gt; 
    &lt;property name="connection.pool_size"&gt;1&lt;/property&gt; 
  
  - &lt;!--  Disable the second-level cache  
    --&gt; 
    &lt;property name="cache.provider_class"&gt;org.hibernate.cache.internal.CollectionCacheInvalidator
    &lt;/property&gt; 
  - &lt;!--  Echo all executed SQL to stdout 
    --&gt; 
    &lt;property name="show_sql"&gt;true&lt;/property&gt; 
  - &lt;!--  Drop and re-create the database schema on startup 
    --&gt; 
    &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt; 
  
    - &lt;!--  SQL dialect 
    --&gt; 
    &lt;property name="dialect"&gt;org.hibernate.dialect.H2Dialect&lt;/property&gt;
  
  - &lt;!--  Names the annotated entity class 
    --&gt; 
    &lt;mapping class="firsthibernateproj.UserDetails" /&gt;
  
    &lt;/session-factory&gt;
    &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Here is the class that I use:</p>
  
  <pre><code>    public class HibernateTest {
      private static Object configuration;
  
  
      public static void main(String[] args) {
          UserDetails user = new UserDetails();
          user.setUserId(1);
          user.setUserName("First User");
  
          Configuration configuration = new Configuration().configure("hibernate.cfg.xml");
          StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().
          applySettings(configuration.getProperties());
          SessionFactory factory = configuration.buildSessionFactory(builder.build()); 
  
  
          Session session = factory.openSession();
          session.beginTransaction();
          session.save(user);
          session.getTransaction().commit();
  
      }
  
  }
  </code></pre>
  
  <p>xml file was checked, there no grammar mistakes.</p>
  
  <p>Any ideas how can I solve this problem?</p>