Apache Connection Pooling for Hibernate

N

Narsing

Guys,

Do anyone of U have a solution for this???

When I try to use the connection pooling of Apache for Hibernate, I get
Class not found exception. I did add the commons-dbcp-1.2.1-jar file to
the class path and added other properties in the config file ...
hibernate.cfg.xml ...
<property
name="hibernate.connection.provider_class">org.hibernate.connection.DBCPConnectionProvider
</property>

<property name="hibernate.dbcp.maxActive">8</property>
<property name="hibernate.dbcp.maxIdle">8</property>
<property name="hibernate.dbcp.maxWait">100</property>
<property name="hibernate.dbcp.whenExhaustedAction">1</property>
<property name="hibernate.dbcp.testOnBorrow">true</property>
<property name="hibernate.dbcp.test OnReturn">true</property>
<property name="hibernate.dbcp.ps.maxActive">8</property>
<property name="hibernate.dbcp.ps.maxIdle">8</property>
<property name="hibernate.dbcp.ps.maxWait">1000*60*30</property>
<property name="hibernate.dbcp.ps.whenExhaustedAction">1</property>






but I am getting the following errors:


FATAL [main] org.hibernate.connection.ConnectionProviderFactory - Could
not instantiate connection provider
java.lang.ClassNotFoundException:
org.hibernate.connection.DBCPConnectionProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:103)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:54)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:301)
at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1497)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1041)
at
org.uabhs.patient.hibernate.HibernateManager.getSessionFactory(HibernateManager.java:27)
at
org.uabhs.patient.util.HibernateUtil.buildGetPatientListSearchCriteria(HibernateUtil.java:169)
at
org.uabhs.patient.services.HibernateEmmiServices.getPatientList(HibernateEmmiServices.java:32)
at org.uabhs.patient.Test.TestClient.main(TestClient.java:56)
SM_EMMI - 2006-09-14 11:13:36,687 ERROR [main]
org.uabhs.patient.hibernate.HibernateManager -
org.hibernate.HibernateException: Could not instantiate connection
provider: org.hibernate.connection.DBCPConnectionProvider
org.hibernate.HibernateException: Could not instantiate connection
provider: org.hibernate.connection.DBCPConnectionProvider
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:58)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:301)
at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1497)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1041)
at
org.uabhs.patient.hibernate.HibernateManager.getSessionFactory(HibernateManager.java:27)
at
org.uabhs.patient.util.HibernateUtil.buildGetPatientListSearchCriteria(HibernateUtil.java:169)
at
org.uabhs.patient.services.HibernateEmmiServices.getPatientList(HibernateEmmiServices.java:32)
at org.uabhs.patient.Test.TestClient.main(TestClient.java:56)
Exception in thread "main"



Any suggestion is appreciated.

Thanks
-Narsing
 
N

Narsing

The solved the problem...there was a type in the config file...
Guys,

Do anyone of U have a solution for this???

When I try to use the connection pooling of Apache for Hibernate, I get
Class not found exception. I did add the commons-dbcp-1.2.1-jar file to
the class path and added other properties in the config file ...
hibernate.cfg.xml ...
<property
name="hibernate.connection.provider_class">org.hibernate.connection.DBCPConnectionProvider
</property>

<property name="hibernate.dbcp.maxActive">8</property>
<property name="hibernate.dbcp.maxIdle">8</property>
<property name="hibernate.dbcp.maxWait">100</property>
<property name="hibernate.dbcp.whenExhaustedAction">1</property>
<property name="hibernate.dbcp.testOnBorrow">true</property>
<property name="hibernate.dbcp.test OnReturn">true</property>
<property name="hibernate.dbcp.ps.maxActive">8</property>
<property name="hibernate.dbcp.ps.maxIdle">8</property>
<property name="hibernate.dbcp.ps.maxWait">1000*60*30</property>
<property name="hibernate.dbcp.ps.whenExhaustedAction">1</property>






but I am getting the following errors:


FATAL [main] org.hibernate.connection.ConnectionProviderFactory - Could
not instantiate connection provider
java.lang.ClassNotFoundException:
org.hibernate.connection.DBCPConnectionProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:103)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:54)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:301)
at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1497)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1041)
at
org.uabhs.patient.hibernate.HibernateManager.getSessionFactory(HibernateManager.java:27)
at
org.uabhs.patient.util.HibernateUtil.buildGetPatientListSearchCriteria(HibernateUtil.java:169)
at
org.uabhs.patient.services.HibernateEmmiServices.getPatientList(HibernateEmmiServices.java:32)
at org.uabhs.patient.Test.TestClient.main(TestClient.java:56)
SM_EMMI - 2006-09-14 11:13:36,687 ERROR [main]
org.uabhs.patient.hibernate.HibernateManager -
org.hibernate.HibernateException: Could not instantiate connection
provider: org.hibernate.connection.DBCPConnectionProvider
org.hibernate.HibernateException: Could not instantiate connection
provider: org.hibernate.connection.DBCPConnectionProvider
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:58)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:301)
at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1497)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1041)
at
org.uabhs.patient.hibernate.HibernateManager.getSessionFactory(HibernateManager.java:27)
at
org.uabhs.patient.util.HibernateUtil.buildGetPatientListSearchCriteria(HibernateUtil.java:169)
at
org.uabhs.patient.services.HibernateEmmiServices.getPatientList(HibernateEmmiServices.java:32)
at org.uabhs.patient.Test.TestClient.main(TestClient.java:56)
Exception in thread "main"



Any suggestion is appreciated.

Thanks
-Narsing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top