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
|