I know I'm probably doing something really stupid here, but when I attempt to configure Hibernate to use c3p0 as its connection pool I get the following stack trace:
Code:
java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at com.mchange.v2.c3p0.impl.DriverManagerDataSource.overrideProps(DriverManagerDataSource.java:177)
at com.mchange.v2.c3p0.impl.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:138)
at com.mchange.v2.c3p0.impl.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:235)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:65)
at com.mchange.v2.resourcepool.BasicResourcePool.assimilateResource(BasicResourcePool.java:721)
at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:502)
at com.mchange.v2.resourcepool.BasicResourcePool.access$000(BasicResourcePool.java:34)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:903)
at com.mchange.v2.async.CarefulRunnableQueue$TaskThread.run(CarefulRunnableQueue.java:145)
My hibernate.properties file is as follows:
Code:
hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg
hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost/mm2?autoReconnect=true
hibernate.connection.username root
hibernate.c3p0.max_size 2
hibernate.c3p0.min_size 2
hibernate.c3p0.timeout 5000
hibernate.c3p0.max_statements 100
hibernate.c3p0.validate false
hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider
hibernate.show_sql false
hibernate.jdbc.batch_size 0
hibernate.jdbc.use_streams_for_binary true