I am having problems trying to implement C3P0 connection pooling in my app. I am using the Netbeans IDE 6.8. My app includes Spring Framework and Spring Web MVC 2.5 and Hibernate (not sure which version, but it is part of the 2.x family - built into Netbeans Platform options).
The error is a noClassDefinition error for my HibernateUtil class. When I remove the C3P0 properties from my hibernate configuration file the error clears up and the site runs.
Here is what my configuration file looks like:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!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.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@xxx.xxx.xxx.xxx:xxxx:********</property>
<property name="hibernate.default_schema">********</property>
<property name="hibernate.connection.username">********</property>
<property name="hibernate.connection.password">********</property>
<property name="hibernate.jdbc.batch_size">20</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.max_size">200</property>
<property name="hibernate.c3p0.min_size">10</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="dwd/dao/entity/Person.hbm.xml"/>
<mapping resource="dwd/dao/entity/Report.hbm.xml"/>
<mapping resource="dwd/dao/entity/Project.hbm.xml"/>
</session-factory>
</hibernate-configuration>