-->
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.  [ 2 posts ] 
Author Message
 Post subject: Could not instantiate C3P0 connection pool
PostPosted: Sat Jan 30, 2010 4:41 am 
Newbie

Joined: Thu Sep 15, 2005 7:45 pm
Posts: 6
I am having a problem with hibernate and c3p0 in Tomcat environments.

I have two fairly similar deployment environments, TEST and PROD. TEST uses Tomcat6.0/MySql6.1; PROD uses Tomcat5.5/MySql5.0. I use c3p0-0.9.1.2.jar and the following in my hibernate.cfg.xml file:

Code:
        <property name="c3p0.min_size">5</property>
        <property name="c3p0.max_size">20</property>
        <property name="c3p0.timeout">1800</property>
        <property name="c3p0.max_statements">50</property>
        <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>


I am also using Spring, and my dao.xml has the following:

Code:
      <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory"><ref local="mySessionFactory"/></property>
      </bean>

      <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="configLocation" value="classpath:hibernate.cfg.xml" />
        <property name="exposeTransactionAwareSessionFactory" value="true"/>


Everything runs fine on TEST, but I can't get PROD to start, the Tomcat log has the following:

Code:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in ServletContext resource [/WEB-INF/lifeplan-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in class path resource [lifeplan-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Could not instantiate C3P0 connection pool
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
   java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:883)
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:584)


I can't figure this out, any ideas on a solution or things I could try?

Thanks,

--Bob


Top
 Profile  
 
 Post subject: Re: Could not instantiate C3P0 connection pool
PostPosted: Sun Jan 31, 2010 2:47 am 
Newbie

Joined: Thu Sep 15, 2005 7:45 pm
Posts: 6
I'm the original poster.

Problem solved. A Tomcat start/stop was needed, simply re-deploying the WAR is not enough.

--Bob


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.