sniperfox
2008-10-17 11:22
浏览 226
已采纳

struts2 spring2 hibernate3 +oracle10G用c3p0出错

[code="java"]

jdbc:oracle:thin:@192.168.130.132:1521:orcl

            <property name="maxPoolSize" value="40"></property>
            <property name="minPoolSize" value="10"></property>
            <property name="initialPoolSize" value="30"></property>
        </bean>[/code]这是spring的配置,使用是出现下列错误

[code="java"]Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)[/code]
而用[code="java"] class="org.apache.commons.dbcp.BasicDataSource">
value="oracle.jdbc.driver.OracleDriver">

value="jdbc:oracle:thin:@192.168.130.132:1521:orcl">




[/code]这样的配置就没有问题,不知道用c3p0
[b]问题补充:[/b]
恩我来用dbcp来配置一下看看

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • huobao89 2008-10-17 12:21
    已采纳

    我一直用dbcp 的。具体不太清楚,不过,我用dbcp时导包了。 你用c3p0导包了吗

    打赏 评论
  • huobao89 2008-10-17 12:22

    有时不导包,编译时不报错

    打赏 评论

相关推荐 更多相似问题