-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Configuring Hibernate with Proxool
PostPosted: Tue Apr 10, 2012 3:38 pm 
Newbie

Joined: Tue Apr 10, 2012 3:26 pm
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: Configuring Hibernate with Proxool
PostPosted: Tue Apr 10, 2012 9:09 pm 
Newbie

Joined: Mon Sep 22, 2008 10:34 am
Posts: 5
Any particular reason you are using an older version of hibernate? There were signficant internal API changes from 3.6 to 4.0. Also, why use Proxool over c3p0? I believe c3p0 is a newer code base, whatever that's worth.


Top
 Profile  
 
 Post subject: Re: Configuring Hibernate with Proxool
PostPosted: Wed Apr 11, 2012 10:37 am 
Newbie

Joined: Tue Apr 10, 2012 3:26 pm
Posts: 2
Hi imagenesis,
We are upgrading to Hibernate 4 soon.

I am looking into Proxool because c3p0 have been giving us fits. I would love to use c3p0 if I can find a solution to the exception that we get when redeploying our code in an eclipse enviroment. We get the following error using c3p0:

Exception in thread "Timer-5" java.lang.OutOfMemoryError: PermGen space.

Basically, we would make a code change in Eclipse and have it set up to "hot" redeploy our app automatically. After a few minutes of a few messages of Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread - #0" the #1, etc. our Tomcat server would just die and i would see on our console screen the fore-mentioned java.lang.OutOfMemoryError PermGen exception.

I must have searched the web for hours looking for a solution and the best I can find is to comment out the line in the c3p0 code: ThreadPoolAsynchronousRunner which was triggering the TimerTask. However, like someone mentioned, "Sometimes the cure is worst than the disease". I, also, tried to increase the JVM memory (i.e. -Xms512m -Xmx1024m), using the following options to launch apached: -XX:+CMSClassUnloadingEnabled -XX:CMSPerGenSweepingEnabled and it STILL did not solve the PermGen exception. It is so frustrating...hence I am looking into other open source connection pooling options.

If you know of a solution to my java.lang.OutOfMemoryError: PermGen space, that would be AWESOME! :)

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.