会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132600个问题
Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 27106楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/手写服务器项目(旧) 27109楼
JAVA 全系列/第十八阶段:亿级高并发电商项目_架构/编码(旧)/电商:完成CMS系统 27111楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/多线程技术(旧) 27112楼

问题:老师我用c3p0数据库连接池用配置文件实现连接时报错了,你看是我这个xml文件建的有问题吗,还是c3p0-0.9.1.2.jar这个版本还需要依赖别的jar包,下面是报的错,最下面是配置文件图片

六月 19, 2020 10:37:26 上午 com.mchange.v2.log.MLog <clinit>

信息: MLog clients using java 1.4+ standard logging.

六月 19, 2020 10:37:27 上午 com.mchange.v2.c3p0.C3P0Registry banner

信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

六月 19, 2020 10:37:27 上午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager

信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 5, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> hellc3p0, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge9eiaa1k63i3np8f2kz|e73f9ac, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc.mysql://localhost:3306/test, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 2, minPoolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

六月 19, 2020 10:37:47 上午 com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run

警告: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1f407bb -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!

六月 19, 2020 10:37:47 上午 com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run

警告: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1f407bb -- APPARENT DEADLOCK!!! Complete Status: 

Managed Threads: 3

Active Threads: 3

Active Tasks: 

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4e0ee3ce (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6fe6fc6b (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7f0acc23 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)

Pending Tasks: 

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@17088d3d

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@2e211c81

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@767ca88a

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5fbe09b2

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@c0c061d

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@2a6fc609

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@39440336

Pool thread stack traces:

Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]

java.lang.Thread.sleep(Native Method)

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)

com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]

java.lang.Thread.sleep(Native Method)

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)

com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]

java.lang.Thread.sleep(Native Method)

com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)

com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)



六月 19, 2020 10:37:56 上午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4e0ee3ce -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 

java.sql.SQLException: No suitable driver

at java.sql.DriverManager.getDriver(DriverManager.java:315)

at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:223)

at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)

at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)

at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)


六月 19, 2020 10:37:56 上午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7f0acc23 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 

java.sql.SQLException: No suitable driver

at java.sql.DriverManager.getDriver(DriverManager.java:315)

at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:223)

at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)

at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)

at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)


六月 19, 2020 10:37:56 上午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6fe6fc6b -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 

java.sql.SQLException: No suitable driver

at java.sql.DriverManager.getDriver(DriverManager.java:315)

at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:223)

at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)

at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)

at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)



java.sql.SQLException: Connections could not be acquired from the underlying database!


at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)

at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)

at com.bjsxt7.connection.C3P0Test.testGetConnection1(C3P0Test.java:31)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)

at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)

at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)

at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)

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)

... 24 more



Process finished with exit code -1

blob.png

JAVA 全系列/第三阶段:数据库编程/JDBC技术(旧) 27113楼
WEB前端全系列/第十一阶段:Nodejs编程模块--/Nodejs基础 27116楼
WEB前端全系列/第二十阶段:Vue2企业级项目(旧)/疫情动态实时播报 27117楼

<template>
  <div class="hello">
   {{ msg }}
    <p v-html="room"></p>
    <a v-bind:href="links.url">{{ links.title }}</a>
    <p>{{1+1}}</p>
    <div>
      <template v-if="flag">
        <p>孙悟空</p>
        <p>唐僧</p>
        <p>猪八戒</p>
        <p>沙和尚</p>
      </template>
      <template v-else>
        <p>六耳猕猴1</p>
        <p>六耳猕猴2</p>
        <p>六耳猕猴3</p>
        <p>六耳猕猴4</p>
      </template>
    </div>
    <p v-show="flag">我是show</p>
    <p v-for="(item,index) in names" v-bind:key="index">{{ item }}</p>
    <p v-for="(item,name,index) in obj" v-bind:key="index">{{name}}:{{item}}: {{index}}</p>
    <p>{{count}}</p>
    <button v-on:mouseover="addCountHandler(10,$event)">按钮</button>
  </div>

</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'HelloWorld',
      flag:true,
      count:0,
      room:"<h2>只是一个h2标签</h2>",
      names:["zhou","jia","quan"],
      obj:{name:"邹雅婷",age:20,sex:"女"},
      id:1002,
      links:{
        title:"周家泉的小屋",
        url:"http://www.baidu.com",
      }
    }
  },
  methods:{
    addCountHandler(data,event){
      console.log(event)
      this.count += data
    }
  }
}
</script>

这个event事件一直报错

image.png

WEB前端全系列/第十九阶段:Vue2知识体系(旧)/Vue基础知识 27118楼
Python 全系列/第八阶段:轻量级Web开发利器-Flask框架/Flask高级 27120楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637