All,
I am trying to configure Hibernate using Proxool but I am getting an error. My environment is on a linux box, hibernate 3.6.3, MySQL, hibernate-proxool-4*.jar and proxool-0.8.3.jar.
My hibernate.cfg.xml is as follows:
Code:
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/projectx</property>
<property name="connection.username">user1</property>
<property name="connection.password">password1</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- <property name="hibernate.connection.provider_class">org.logicalcobwebs.proxool.ProxoolDriver</property> -->
<!-- <property name="hibernate.connection.provider_class">net.sf.hibernate.connection.ProxoolConnectionProvider</property> -->
[b]<property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.ProxoolConnectionProvider</property>[/b]
<!-- <property name="hibernate.proxool.house-keeping-sleep-time">30000</property>
<property name="hibernate.proxool.maximum-connection-count">4</property>
<property name="hibernate.proxool.maximum-connection-lifetime">4</property>
<property name="hibernate.proxool.simultaneous-build-throttle">2</property>
<property name="hibernate.proxool.maximum-active-time">500</property>
<property name="hibernate.proxool.minimum-connection-count">2</property> -->
<mapping resource="com/gat/projectx/Test.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I keep getting the error:
java.lang.ClassNotFoundException: org.hibernate.service.jdbc.connections.spi.ConnectionProvider
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
at org.hibernate.connection.ConnectionProviderFactory.initializeConnectionProviderFromConfig(ConnectionProviderFactory.java:174)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:102)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2836)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2832)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
at com.ngc.mav.models.MAVHibernateDataManager.<init>(Unknown Source)
at com.ngc.mav.framework.AbstractMAVController.<clinit>(Unknown Source)
at com.ngc.mavadmin.MAVAdminControllerManager.registerControllers(MAVAdminControllerManager.java:18)
at com.ngc.mav.framework.AbstractMAVControllerManager.init(Unknown Source)
at com.ngc.mavadmin.MAVAdminApplication.init(MAVAdminApplication.java:20)
at com.vaadin.Application.start(Application.java:554)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1213)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:484)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
or sometimes if I used (as someone mentioned on this message board):
<property name="hibernate.connection.provider_class">net.sf.hibernate.connection.ProxoolConnectionProvider</property>
I then get the error org.hibernate.HibernateException:Could not instantiate connection provider:net.sf.hibernate.connection.ProxoolConnectionProvider
It is probably something simple that I am missing. Thanks in advance.