title: Hibernate configuration with mysql gives ERROR -  SAXParseException
body: <p>I'm trying to configure hibernate with mysql.</p>
  
  <p>Following is the <code>hibernate.cfg.xml</code>:</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
      &lt;session-factory&gt;    
          &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/TestDB&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;root123&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  
  
          &lt;property name="hdm2ddl.auto"&gt;create&lt;/property&gt;property&gt;
          &lt;property name="show_sql"&gt;false&lt;/property&gt;
  
  
          &lt;!-- Use the C3P0 connection pool provider --&gt;
          &lt;property name="hibernate.c3p0.min_size"&gt;5&lt;/property&gt;
          &lt;property name="hibernate.c3p0.max_size"&gt;20&lt;/property&gt;
          &lt;property name="hibernate.c3p0.timeout"&gt;300&lt;/property&gt;
          &lt;property name="hibernate.c3p0.max_statements"&gt;50&lt;/property&gt;
          &lt;property name="hibernate.c3p0.idle_test_period"&gt;3000&lt;/property&gt;
  
          &lt;mapping resource="com/psl/course/Course.hbm.xml"/&gt;
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>However, I'm getting following error. Stack trace is is follows,</p>
  
  <pre>15 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
  31 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
  31 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
  47 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
  78 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
  78 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
  156 [main] ERROR org.hibernate.util.XMLHelper - Error parsing XML: /hibernate.cfg.xml(26) The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".
  Initial SessionFactory creation failed.org.hibernate.MappingException: invalid configuration
  Exception in thread "main" java.lang.ExceptionInInitializerError
      at com.psl.util.HibernateUtil.(HibernateUtil.java:13)
      at com.psl.course.Main.saveCourse(Main.java:34)
      at com.psl.course.Main.main(Main.java:16)
  Caused by: org.hibernate.MappingException: invalid configuration
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1521)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)
      at com.psl.util.HibernateUtil.(HibernateUtil.java:10)
      ... 2 more
  Caused by: org.xml.sax.SAXParseException: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.dom4j.io.SAXReader.read(SAXReader.java:465)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)
      ... 5 more
  </pre>
  
  <p>Help please, where am I going wrong?</p>