2 dywailly dywailly 于 2016.09.12 08:30 提问

c3p0配置数据源一直报错,虽然不影响开发,但是总是报错很让人难受,求大神们帮忙看看,10C币奉上 10C

以下是错误信息:
Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@1e8491f3
java.lang.NullPointerException
at com.mysql.jdbc.StatementImpl.realClose(StatementImpl.java:2307)
at com.mysql.jdbc.PreparedStatement.realClose(PreparedStatement.java:2688)
at com.mysql.jdbc.ConnectionImpl.closeAllOpenStatements(ConnectionImpl.java:1489)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4289)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1461)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:326)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:115)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C3P0PooledConnectionPool.java:185)
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:576)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)
下面是我配置数据源的配置信息:
图片说明

4个回答

Marksinoberg
Marksinoberg   Ds   Rxr 2016.09.12 08:55

貌似是connection归还出现了异常。而且里面有一个空指针异常。希望根据这个思路试试debug

Veggiel
Veggiel   2016.09.12 08:55

class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">












Veggiel
Veggiel   2016.09.12 08:56
 <bean id="dataSource"
        class="com.mchange.v2.c3p0.ComboPooledDataSource"
        destroy-method="close">
        <property name="driverClass" value="${c3p0.driverClass}"></property>
        <property name="jdbcUrl" value="${c3p0.url}"></property>
        <property name="user" value="${c3p0.user}"></property>
        <property name="password" value="${c3p0.password}"></property>
        <property name="acquireIncrement" value="${c3p0.acquireIncrement}"></property>
        <property name="initialPoolSize" value="${c3p0.initialPoolSize}"></property>
        <property name="maxIdleTime" value="${c3p0.maxIdleTime}"></property>
        <property name="maxPoolSize" value="${c3p0.maxPoolSize}"></property>
        <property name="minPoolSize" value="${c3p0.minPoolSize}"></property>
        <property name="acquireRetryDelay" value="1000"></property>
        <property name="acquireRetryAttempts" value="60"></property>
        <property name="breakAfterAcquireFailure" value="false"></property>
    </bean>
qq_28787169
qq_28787169   2016.09.12 17:46

换个数据源吧,这个前两天在项目中也有遇到,暂时找不到问题,换了dataSourc就没报错了,推荐appach的或者alibaba的

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!