title: Problems using Hibernate - JDBC Driver class not found: com.mysql.jdbc.Driver
body: <p>I have a really strange issue when using hibernate to connect to a MySQLDB and add data.</p>
  
  <p>This is the error I get:</p>
  
  <blockquote>
    <p>JDBC Driver class not found:
    com.mysql.jdbc.Driver</p>
  </blockquote>
  
  <p>This is how my hibernate.cfg.xml looks like</p>
  
  <pre><code>&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="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/fpa-webapp&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLInnoDBDialect&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="hbm2ddl.auto"&gt;update&lt;/property&gt;
          &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I dont understand why I see a 500 Error when I navigate to the application; it says that the driver is not found.</p>
  
  <blockquote>
    <p>HTTP ERROR 500</p>
    
    <p>Problem accessing /fpa-webapp/.
    Reason:</p>
  
  <pre><code>Exception constructing service 'ValueEncoderSource': Error invoking
  </code></pre>
    
    <p>service builder method
    org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map,
    InvalidationEventHub) (at
    TapestryModule.java:2287) (for service
    'ValueEncoderSource'): Error invoking
    service contribution method
    org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration,
    boolean, HibernateSessionSource,
    Session, TypeCoercer, PropertyAccess,
    LoggerSource): Exception constructing
    service 'HibernateSessionSource':
    Error invoking service builder method
    org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionSource(Logger,
    List, RegistryShutdownHub) (at
    HibernateCoreModule.java:123) (for
    service 'HibernateSessionSource'):
    JDBC Driver class not found:
    com.mysql.jdbc.Driver</p>
  </blockquote>
  
  <p>I'm sure the driver is in the class path.</p>
  
  <p>What it could be?</p>