title: hibernate properties not found
body: <p>we are integrating the java blazeds hibernate with flex project..First we tested the pure java hibernate in eclipse and it is executing fine. But when we put the same in tomcat for flex integration with blazeds it is showing the following error.this is the only error.</p>
  
  <pre><code>Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: Hibernate 3.2.6
  Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: hibernate.properties not found
  Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment buildBytecodeProvider
  INFO: Bytecode provider name : cglib
  Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: using JDK 1.4 java.sql.Timestamp handling
  Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Configuration configure
  INFO: configuring from resource: /hibernate.cfg.xml
  Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Configuration getConfigurationInputSt
  ream
  INFO: Configuration resource: /hibernate.cfg.xml
  </code></pre>
  
  <p>this is the hibernate.cfg.xml(To identify whether hibernate.cfg.xml is not found and i  tested by deleting DOCTYPE of .cfg.xml then tomcat output displayed saying the root element is not found...which means it is able to find the hibernate.cfg.xml( i think)</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="connection.url"&gt;jdbc:mysql://localhost/test&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="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
          &lt;property name="format_sql"&gt;true&lt;/property&gt;
  
          &lt;!-- JDBC connection pool (use the built-in) --&gt;
          &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  
           &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
          &lt;mapping class="com.model.User" /&gt;
          &lt;mapping class="com.model.UserDetails" /&gt;
          &lt;mapping class="com.model.LoanDetails" /&gt;
          &lt;mapping class="com.model.BorrowerDetails" /&gt;
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>this is hiberutil.java</p>
  
  <pre><code>public class HibernateUtil
  {
  
  
  
      private static  SessionFactory sessionFactory=configureSessionFactory();
      private static ServiceRegistry serviceRegistry;
  
  
      private static SessionFactory configureSessionFactory() throws HibernateException {
          Configuration configuration = new Configuration();
          configuration.configure();
          serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();        
          sessionFactory = configuration.buildSessionFactory(serviceRegistry);
          return sessionFactory;
      }
      public static SessionFactory getSessionFactory()
      {
          return sessionFactory;
      }
  }
  </code></pre>
  
  <p>why the error is showing? the control is coming from flex side and executing the starting point of the java method...but when it comes to hibernate stuff execution, it is showing this error in tomcat...</p>
  
  <p>But when i execute java+hibernate as a pure java application it is executing fine..</p>
  
  <p>can anybody help me?</p>
  
  <p>Thanks</p>
  
  <p>EDIT 1 After the modification suggested by @Andremoniy and putting the .cfg.xml in src folder and here also in eclipse it is working but not in tomcat with flex</p>
  
  <p>following error comes</p>
  
  <pre><code>org.hibernate.MappingException: An AnnotationConfiguration instance is required
  to use &lt;mapping class="com.model.User"/&gt;
          at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.jav
  a:1606)
          at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.jav
  a:1561)
          at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
          at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
          at org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
          at org.hibernate.cfg.Configuration.configure(Configuration.java:1420)
          at com.sample.HibernateUtil.configureSessionFactory(HibernateUtil
  .java:26)
          at com.sample.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:20)
          at com.sample.App.checkUser(App.java:34)
  </code></pre>