title: Hibernate search cfg file error
body: <p>I'm new to hibernate search and I just started to make a sample search project using internet "how-to s". every thing seems fine except that when I try to run project I got the fallowing errors:</p>
  
  <pre><code>Jan 7, 2012 4:10:41 PM org.hibernate.annotations.common.Version &lt;clinit&gt;
  INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
  Jan 7, 2012 4:10:41 PM org.hibernate.Version logVersion
  INFO: HHH000412: Hibernate Core {4.0.0.Final}
  Jan 7, 2012 4:10:41 PM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: HHH000206: hibernate.properties not found
  Jan 7, 2012 4:10:41 PM org.hibernate.cfg.Environment buildBytecodeProvider
  INFO: HHH000021: Bytecode provider name : javassist
  Jan 7, 2012 4:10:41 PM org.hibernate.cfg.Configuration configure
  INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
  Jan 7, 2012 4:10:41 PM org.hibernate.cfg.Configuration getConfigurationInputStream
  INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(4) Element type "hibernate-configuration" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(6) Element type "session-factory" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(11) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(13) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(16) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(17) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(18) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(21) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(25) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(27) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(31) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(32) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(34) Element type "property" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(36) Element type "listener" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(37) Element type "listener" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(38) Element type "listener" must be declared.
  Jan 7, 2012 4:10:41 PM org.hibernate.internal.util.xml.XMLHelper$ErrorLogger error
  ERROR: HHH000197: Error parsing XML: /hibernate.cfg.xml(40) Element type "mapping" must be declared.
  </code></pre>
  
  <p>but I declared all of the errors, here's my 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://www.hibernate.org/dtd/"&gt;
  
  &lt;hibernate-configuration&gt;
  
      &lt;session-factory&gt;
  
          &lt;!-- 
          &lt;property name="dialect"&gt;org.hibernate.dialect.PostgreSQLDialect&lt;/property&gt;
           --&gt;
          &lt;property name="cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt;
  
          &lt;property name="connection.url"&gt;
              jdbc:mysql://localhost:3306/hsearchexample
          &lt;/property&gt;
          &lt;property name="connection.username"&gt;root&lt;/property&gt;
          &lt;property name="connection.password"&gt;&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="hibernate.search.default.directory_provider"&gt;org.hibernate.search.store.FSDirectoryProvider&lt;/property&gt;
  
          &lt;property name="hibernate.search.default.indexBase"&gt;
              ./searchTMP/indexes
          &lt;/property&gt;
  
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
          &lt;property name="hbm2ddl.auto"&gt;create-drop&lt;/property&gt;
  
          &lt;listener type="post-insert" class="org.hibernate.search.event.FullTextIndexEventListener"/&gt; 
          &lt;listener type="post-update" class="org.hibernate.search.event.FullTextIndexEventListener"/&gt; 
          &lt;listener type="post-delete" class="org.hibernate.search.event.FullTextIndexEventListener"/&gt;
  
          &lt;mapping class="ir.ehphan.search.Article" /&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I don't know what to do? and I don't seem to be finding answers using google... please help me. thanks in advance. </p>