title: How to fix error with my first Hibernate project?
body: <p>I have been tried to make my first Hibernate project. I added following libraries into my project:</p>
  
  <p>antlr-2.7.7
  commons-collections-3.2.1
  dom4j-1.6.1
  hibernate-commons-annotations-4.0.1.Final
  hibernate-core-4.1.0.Final
  hibernate-jpa-2.0-api-1.0.1.Final
  javassist-3.15.0-GA
  jboss-logging-3.1.0.CR2
  jboss-transaction-api_1.1_spec-1.0.0.Final
  mysql-connector-java-5.1.18-bin</p>
  
  <p>hibernate.cfg.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost/test&lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
  
      &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;&lt;/property&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQL5Dialect&lt;/property&gt;
  
      &lt;mapping class="com.nda.hibernate.Person"/&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Person.class:</p>
  
  <pre><code>package com.nda.hibernate;
  
  import javax.persistence.Entity;
  import javax.persistence.Id;
  
  
  @Entity
  public class Person {
  
      private String name;
  
      @Id
      private int number;
  
      public Person() {}
  
      public Person(String name, int number) {
  
          this.name=name;
          this.number=number;
      }
  
      public void setName(String name) {
          this.name=name;
      }
  
      public String getName() {
          return name;
      }
  
      public void setNumber(int number) {
          this.number=number;
      }
  
      public int getNumber() {
          return number;
      }
  }
  </code></pre>
  
  <p>I have Denwer installed. Parameters for using: login - root, password is empty. Server is localhost, and has database "test" with table "person"(CHAR(50) name, INT(10) number - primary key) </p>
  
  <p>Main.class:</p>
  
  <pre><code>    SessionFactory sessions=new AnnotationConfiguration().configure().buildSessionFactory();
      Session session=sessions.openSession();
  </code></pre>
  
  <p>It doesn't work. I have got some errors:</p>
  
  <pre><code>03.03.2012 14:11:07 org.hibernate.annotations.common.Version &lt;clinit&gt;
  INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
  03.03.2012 14:11:07 org.hibernate.Version logVersion
  INFO: HHH000412: Hibernate Core {4.1.0.Final}
  03.03.2012 14:11:07 org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: HHH000206: hibernate.properties not found
  03.03.2012 14:11:07 org.hibernate.cfg.Environment buildBytecodeProvider
  INFO: HHH000021: Bytecode provider name : javassist
  03.03.2012 14:11:07 org.hibernate.cfg.Configuration configure
  INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
  03.03.2012 14:11:07 org.hibernate.cfg.Configuration getConfigurationInputStream
  INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
  03.03.2012 14:11:07 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
  WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
  03.03.2012 14:11:07 org.hibernate.cfg.Configuration doConfigure
  INFO: HHH000041: Configured SessionFactory: null
  03.03.2012 14:11:07 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
  03.03.2012 14:11:07 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  INFO: HHH000115: Hibernate connection pool size: 20
  03.03.2012 14:11:07 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  INFO: HHH000006: Autocommit mode: false
  03.03.2012 14:11:07 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost/test]
  03.03.2012 14:11:07 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  INFO: HHH000046: Connection properties: {user=root, password=****}
  03.03.2012 14:11:08 org.hibernate.dialect.Dialect &lt;init&gt;
  INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
  03.03.2012 14:11:08 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
  INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
  03.03.2012 14:11:08 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory &lt;init&gt;
  INFO: HHH000397: Using ASTQueryTranslatorFactory
  </code></pre>
  
  <p>How can I fix it? Thank you. </p>