I have a very strange problem when using hibernate to connect to MySQLDB and add data.
This is the error I get:
JDBC Driver class not found: com.mysql.jdbc.Driver
This is what my hibernate.cfg.xml looks like
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/fpa-webapp</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password"></property> <property name="hbm2ddl.auto">update</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.format_sql">true</property> </session-factory> </hibernate-configuration>
I do not understand why I see a 500 error when switching to the application; he says the driver was not found.
HTTP ERROR 500
Problem with access / fpa -webapp /. Cause:
Exception constructing service 'ValueEncoderSource': Error invoking
method for constructing the service org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource (Map, InvalidationEventHub) (when TapestryModule.java:2287) (for servicing 'ValueEncoderSource'): calling the error service fee method org.apache.tapestryHiber.hiber. contributeValueEncoderSource (MappedConfiguration, boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, LoggerSource): creating an exception service "HibernateSessionSource": Error while calling the method for constructing service org.apache.tapestryHourceNodeSourceModeule ListerBuberSourceModule ListerHubnodeSourceModuleBuery Library HibernateCoreModule.java:123) (for the "HibernateSessionSource" service): JDBC driver class not found: com.mysql.jdbc.Driver
I am sure the driver is in the class path.
What could it be?
source share