Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Apache Connection Pooling for Hibernate

Thread view: 
Narsing - 14 Sep 2006 17:38 GMT
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
Narsing - 14 Sep 2006 17:47 GMT
The solved the problem...there was a type in the config file...

> Guys,
>
[quoted text clipped - 82 lines]
> Thanks
> -Narsing


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.