spring tomcat 链接池问题

南瓜饼 发布于 2013/04/27 16:46
阅读 253
收藏 1
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:217)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:174)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:653)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:595)

16:45:10,679  INFO BeanSelectionProvider:42 - Choosing bean (spring) for (com.opensymphony.xwork2.ObjectFactory)


spring 配置文件 

<bean id="poolProperties" class="org.apache.tomcat.jdbc.pool.PoolProperties">
   <property name="url" value="jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=UTF-8"/>
   <property name="username" value="test"/>
   <property name="password" value="test"/>
   <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
   <property name="testWhileIdle" value="true"/>
   <property name="testOnBorrow" value="true"/>
   <property name="testOnReturn" value="false"/>
   <property name="validationQuery" value="SELECT 1"/>
   <property name="validationInterval" value="30000"/>
   <property name="timeBetweenEvictionRunsMillis" value="30000"/>
   <property name="maxActive" value="2"/>
   <property name="minIdle" value="1"/>
   <property name="maxWait" value="2"/>
   <property name="maxIdle" value="2"/>
   <property name="initialSize" value="1"/>
   <property name="removeAbandonedTimeout" value="60"/>
   <property name="removeAbandoned" value="false"/>
   <property name="logAbandoned" value="true"/>
<property name="minEvictableIdleTimeMillis" value="30000"/>
   <property name="jmxEnabled" value="true"/>
   <property name="jdbcInterceptors" value="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"/>
</bean>

<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource">
<property name="poolProperties" ref="poolProperties"/>
</bean>
是用tomcat来做链接池,结果不能启动,是什么原因,该有的包都加入进去了的

加载中
0
sunyh
sunyh
你这是死循环了吧
0
南瓜饼
南瓜饼
不是,我启动项目的时候,就出错了
0
南瓜饼
南瓜饼
tomcat 来做的链接池,感觉链接池没有配置正确
返回顶部
顶部