title: Error message: Exception in thread "main" org.hibernate.HibernateException: Error accessing stax stream
body: <p>I´m trying to create a MySQL database table by using hibernate but I get this error message:</p>
  
  <pre><code>Exception in thread "main" org.hibernate.HibernateException: Error accessing stax stream
      at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:107)
      at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:65)
      at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:57)
      at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:163)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:259)
      at com.anika.hibernate.Main.main(Main.java:18)
  Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,34]
  </code></pre>
  
  <p>This answers do not solve my problem: <a href="https://stackoverflow.com/questions/33483221/error-connecting-with-database-using-hibernate">Error connecting with database using hibernate</a></p>
  
  <p><a href="https://stackoverflow.com/questions/34527096/exception-in-thread-main-org-hibernate-hibernateexception-error-accessing-sta">Exception in thread &quot;main&quot; org.hibernate.HibernateException: Error accessing stax stream</a></p>
  
  <p>This is my Main.java file:</p>
  
  <pre><code>package com.anika.hibernate;
  
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.hibernate.cfg.Configuration;
  
  
  
  public class Main {
  
      public static void main(String[] args){
  
      Student_Info student = new Student_Info();
  
      student.setName("Anika");
      student.setRollNo(1);
  
      SessionFactory sessionFactory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();   
      Session session = sessionFactory.openSession();
      session.beginTransaction();
  
      session.save(student);
  
      session.getTransaction().commit();
      session.close();
      sessionFactory.close();
  
  
      }   
  
  }
  </code></pre>
  
  <p>My hibernate.cfg.xml:</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://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;!--
    ~ Hibernate, Relational Persistence for Idiomatic Java
    ~
    ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
    ~ See the lgpl.txt file in the root directory or &lt;http://www.gnu.org/licenses/lgpl-2.1.html&gt;.
    --&gt;
  &lt;hibernate-configuration
  
    &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/hibernatetutorials&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;!-- Disable the second-level cache  --&gt;
      &lt;property name="cache.provider_class"&gt;org.hibernate.cache.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;create&lt;/property&gt;
      &lt;mapping class="com.anika.hibernate.Stundent_Info"/&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Thank you for your help</p>