-->
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: C3P0 Connection Pooling Issue
PostPosted: Mon Mar 05, 2007 12:44 am 
Newbie

Joined: Tue Feb 13, 2007 2:24 am
Posts: 4
Hi Friends,

This is regarding the exception that is thrown when we are trying to use the C3P0 JDBC Connection pool for establishing connections to the database.

The following is the configuration for C3P0 in the hibernate.cfg.xml file.

<property name="c3p0.max_size">50</property>
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">100</property>
<property name="c3p0.max_statements">100</property>
<property name="c3p0.min_size">30</property>
<property name="c3p0.timeout">100</property>


Things are working fine when we dont set the property
"<property name="c3p0.max_size">100</property> ".
But when we set c3p0.max_size property its throwing the following exception.


-------------------------------------------------------------------------------------
java.lang.ExceptionInInitializerError
at com.mchange.v2.c3p0.PoolConfig.(PoolConfig.java:93)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:84)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:397)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
at events.HibernateUtil.getSessionfactory(HibernateUtil.java:56)
at events.HibernateUtil.getSession(HibernateUtil.java:49)
at events.FortestManager.doGet(FortestManager.java:104)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: org.apache.naming.resources.FileDirContext
at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1585)
at org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:914)
at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1111)
at java.lang.Class.getResourceAsStream(Unknown Source)
at com.mchange.v2.cfg.BasicMultiPropertiesConfig.(BasicMultiPropertiesConfig.java:48)
at com.mchange.v2.cfg.BasicMultiPropertiesConfig.(BasicMultiPropertiesConfig.java:39)
at com.mchange.v2.cfg.MultiPropertiesConfig.read(MultiPropertiesConfig.java:64)
at com.mchange.v2.cfg.MultiPropertiesConfig.readVmConfig(MultiPropertiesConfig.java:73)
at com.mchange.v2.log.MLog.(MLog.java:48)

------------------------------------------------------------------------------------

Please can any one help us to resolve this issue. Thanks in advance.

Thanks,
Jim


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 5:11 pm 
Newbie

Joined: Wed May 16, 2007 4:13 pm
Posts: 5
You didn't provide any additional information like what database you are using, what your configuration files look like, but have you checked (I hopey you have) that your setting for c3p0.max_size" doesn't exceed what your database is set up for? I've seen a similar problem when using MySQL.

good luck!


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.