tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54235] New: tomcat jdbc pool stackoverflow error used with spring
Date Mon, 03 Dec 2012 11:29:47 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54235

            Bug ID: 54235
           Summary: tomcat jdbc pool stackoverflow error used with spring
           Product: Tomcat Modules
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: jdbc-pool
          Assignee: dev@tomcat.apache.org
          Reporter: yanky.young@gmail.com
    Classification: Unclassified

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.post@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)

And by tomcat container resource configuration, I find a workaround to make
jdbc pool work with spring: 
1. add a Resource section in tomcat server.xml to make a global naming resource
2. add a resource-ref section in WEB-INF/web.xml to reference container
resource
3. add a bean section to spring applicationContext.xml to reference container
resouce by spring provided JndiObjectFacetoryBean

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message