Thanks for help. I submit a bug here: 
https://issues.apache.org/bugzilla/show_bug.cgi?id=54235

Yanky

------------------ ???????? ------------------
??????: "Konstantin Kolinko"<knst.koli...@gmail.com>;
????????: 2012??12??2??(??????) ????6:24
??????: "Tomcat Users List"<users@tomcat.apache.org>; 

????: Re: tomcat jdbc pool stackoverflow error used with spring



2012/12/2 ?????? <22687...@qq.com>:
> Hi:
>
> I'm evaluating jdbc pool after reading some blogs on  tomcatexpert.com. But 
> when I try to switch to jdbc pool from dbcp, I'm  getting stackoverflow error 
> like this:
>
> Caused by: java.lang.StackOverflowError
>     at 
> java.util.concurrent.AbstractExecutorService.<init>(AbstractExecutorService.java:71)
>     at 
> java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1270)
>     at 
> java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1163)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:117)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:86)
>     at 
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:224)
>     at 
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:86)
>     at 
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:224)
>     at 
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485)
>     at 
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
>     at 
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:86)
>     at 
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:224)
>
> and I noticed that someone had the same issue before but not answered:
> http://mail-archives.apache.org/mod_mbox/tomcat-users/201107.mbox/%3c32046311.p...@talk.nabble.com%3E
>
> my web app is a typical springmvc+hibernate application, and here is my 
> applicationcontext datasource part:
>
> <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" 
> destroy-method="close">
> <property name="driverClassName" value="${telregistry.jdbc.driverClassName}" 
> />
> <property name="url" value="${telregistry.jdbc.url}"/>
> <property name="username" value="${telregistry.jdbc.username}"/>
> <property name="password" value="${telregistry.jdbc.password}"/>
> <property name="initialSize" value="5"/>
> <property name="initSQL" value="SELECT 1"/>
> <property name="minIdle" value="5"/>
> <property name="maxIdle" value="50"/>
> <property name="maxActive" value="100"/>
> <property name="maxWait" value="6000"/>
> <property name="validationInterval" value="1800000"/>
> <property name="validationQuery" value="SELECT 1"/>
> </bean>
>
> my system:
> win7 32bit
> jdk1.7.0_9(also test on jdk1.6.0_25)
> mysql 5.5(also test oracle11g)
> spring 3.1.0
> jdbc pool(tomcat-jdbc-7.0.30.jar from official maven repo)
>
> Also I test jdbc pool under tomcat7 as a container resource. It works. It 
> seems that jdbc pool cannot come along with spring.


1. Please file an issue in Bugzilla.
There were no fixes in jdbc-pool module between 7.0.30 and the current
version 7.0.33, so the bug should still be there.

2. This is caused by "<property name="initialSize" value="5"/>" in
your configuration.
The ConnectionPool.init(..) method tries to open those 5 connections
and fails with a recursion.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to