title: Error in configuring hibernate 5.0.1 and MySQL
body: <p>I have problem configuring the hibernate 5.0.1 with MySQL, I saw some questions here stating there is a bug in the version 4, I am not sure weather this is the same bug or I am doing something wrong.</p>
  
  <p>Here is my configuration file
  hibernate.cfg.xml</p>
  
  <pre><code>&lt;hibernate-configuration
          xmlns="http://www.hibernate.org/xsd/hibernate-configuration"
          xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-configuration hibernate-configuration-4.0.xsd"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;session-factory&gt;
      &lt;!-- Database connection settings --&gt;
      &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306/hibernatedb&lt;/property&gt;
      &lt;property name="connection.username"&gt;root&lt;/property&gt;
      &lt;property name="connection.password"&gt;&lt;/property&gt;
  
      &lt;!-- JDBC connection pool (use the built-in) --&gt;
      &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  
      &lt;!-- SQL dialect --&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  
      &lt;!-- Enable Hibernate's automatic session context management --&gt;
      &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
      &lt;!-- Disable the second-level cache  --&gt;
      &lt;property name="cache.provider_class"&gt;org.hibernate.cache.internal.NoCacheProvider&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;update&lt;/property&gt;
  
      &lt;mapping resource="org.cypher.dto.UserDetails"/&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>and here is my sessionfactory code</p>
  
  <pre><code>SessionFactory sessionfactory = new Configuration().configure().buildSessionFactory();
  Session session = sessionfactory.openSession();
  session.beginTransaction();
  session.save(user);
  session.getTransaction().commit();
  </code></pre>
  
  <p>Here is the error log.</p>
  
  <pre><code>Exception in thread "main" org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 12 and column 63 in RESOURCE hibernate.cfg.xml. Message: cvc-elt.1: Cannot find the declaration of element 'hibernate-configuration'.
      at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:133)
      at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:65)
      at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:55)
      at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:163)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:259)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:245)
      at org.cypher.hibernate.HibernateTest.main(HibernateTest.java:15)
  Caused by: javax.xml.bind.UnmarshalException
  </code></pre>
  
  <p>Thanks.</p>