NutzCN Logo
问答 各位大神,请教一下问题?nutz使用c3p0连接池报下面的异常错误?数据库帐号和密码都没有错
发布于 3021天前 作者 qq_6427b776 6280 次浏览 复制 上一个帖子 下一个帖子
标签:

2016-09-14 15:20:48,363 [localhost-startStop-1] ERROR org.nutz.mvc.impl.NutLoading - Error happend during start serivce!
org.nutz.ioc.IocException: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> true, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jaz83t41qdizsw|5960c164, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jaz83t41qdizsw|5960c164, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3308/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 6000, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 500, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 30, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> select 1, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.lang.Lang.wrapThrow(Lang.java:157)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:105)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:181)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:199)
at com.venustech.tsoc.cupid.logging.LoggingProcessor.init(SourceFile:175)
at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:34)
at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:46)
at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:175)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:91)
at com.venustech.tsoc.CupidNutLoading.load(SourceFile:22)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:54)
at com.venustech.tsoc.CupidNutFilter.init(SourceFile:36)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> true, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jaz83t41qdizsw|5960c164, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jaz83t41qdizsw|5960c164, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3308/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 6000, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 500, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 30, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> select 1, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:67)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:76)
... 28 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
... 30 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at org.nutz.lang.Lang.wrapThrow(Lang.java:141)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:154)
at org.nutz.dao.impl.NutDao.(NutDao.java:91)
... 35 more
Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:527)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
at org.nutz.trans.Trans.getConnectionAuto(Trans.java:252)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:96)
... 37 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1317)
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)
... 40 more
九月 14, 2016 3:20:49 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> true, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jaz83t41qdizsw|5960c164, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jaz83t41qdizsw|5960c164, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3308/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 6000, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 500, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 30, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> select 1, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.lang.Lang.wrapThrow(Lang.java:157)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:109)
at com.venustech.tsoc.CupidNutLoading.load(SourceFile:22)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:54)
at com.venustech.tsoc.CupidNutFilter.init(SourceFile:36)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.ioc.IocException: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> true, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jaz83t41qdizsw|5960c164, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jaz83t41qdizsw|5960c164, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3308/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 6000, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 500, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 30, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> select 1, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.lang.Lang.wrapThrow(Lang.java:157)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:105)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:181)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:199)
at com.venustech.tsoc.cupid.logging.LoggingProcessor.init(SourceFile:175)
at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:34)
at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:46)
at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:175)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:91)
... 21 more
Caused by: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> true, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jaz83t41qdizsw|5960c164, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jaz83t41qdizsw|5960c164, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3308/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 6000, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 500, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 30, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> select 1, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:67)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:76)
... 28 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
... 30 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at org.nutz.lang.Lang.wrapThrow(Lang.java:141)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:154)
at org.nutz.dao.impl.NutDao.(NutDao.java:91)
... 35 more
Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:527)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
at org.nutz.trans.Trans.getConnectionAuto(Trans.java:252)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:96)
... 37 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1317)
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)

... 40 more

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
下面是dao.xml文件
<ioc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="nutz-ioc-0.1.xsd">

<obj name="dataSourceProperties" type="com.venustech.tsoc.cupid.commons.data.C3P0PropertiesWrapper">
    <field name="user"><str>root</str></field>
    <field name="password"><str>Nq6T8urFx4qip8tlJYfXLg==</str></field>
</obj>

<!-- [if db.driver ~i mysql] -->
<obj name="dataSource" type="com.mchange.v2.c3p0.ComboPooledDataSource">
    <events>
       <depose>close</depose>
    </events>
    <field name="driverClass"><str>com.mysql.jdbc.Driver</str></field>

    <!--
       如使用IPv6进行数据库连接,则连接串使用:
       mysql jdbc: jdbc:mysql://address=(protocol=tcp)(host=::1)(port=3308)/tsoc?......
       mariadb jdbc: jdbc:mysql://[::1]:3308/tsoc?......
    -->

    <!-- [if deploy.os.target = windows] -->
    <field name="jdbcUrl"><str>jdbc:mysql://127.0.0.1:3308/tsoc?useUnicode=true&amp;characterEncoding=UTF-8&amp;rewriteBatchedStatements=true&amp;useLocalSessionState=true</str></field>
    <!-- [endif] -->
    <field name="maxPoolSize"><int>500</int></field>
    <field name="minPoolSize"><int>30</int></field>
    <field name="maxIdleTime"><int>6000</int></field>
    <field name="checkoutTimeout"><int>5000</int></field>
    <field name="autoCommitOnClose"><bool>true</bool></field>
    <field name="preferredTestQuery"><str>select 1</str></field>
    <field name="properties"><java>$dataSourceProperties.properties</java></field>
</obj>
<!-- [endif] -->


<obj name="dao" type="org.nutz.dao.impl.NutDao">
    <args>
       <refer>dataSource</refer>
    </args>
</obj>
<obj name="mongoDataSource" type="com.mongodb.Mongo">
    <args>
       <str>localhost</str>
       <int>30000</int>
       <!-- 
       <obj name="options" type="com.mongodb.MongoOptions">
         <!- 单位毫秒,默认无超时 
         field name="connectTimeout"><int></int></field->
         <!- 等待获取连接的时间
         <field name="maxWaitTime"><int>120000</int></field->
         <!- 单位毫秒,默认无超时
         <field name="socketTimeout"><int></int></field ->
         <field name="connectionsPerHost"><int>10</int></field>
         <field name="threadsAllowedToBlockForConnectionMultiplier"><int>5</int></field>
       </obj>
       -->
    </args>
</obj>

14 回复

A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@58b7fd45 -- timeout at awaitAvailable()

连不上数据库呢,检查相关参数,防火墙等等

来自炫酷的 NutzCN

另外,mysql默认3306,你写的是3308

来自炫酷的 NutzCN

我自己本机的,都需要检查防火墙?相关参数我都放出来了

@wendal 我的端口是3308,因为是maradb,跟mysql区分一下

要么数据库没启动,要么帐号密码错

来自炫酷的 NutzCN

不用c3p0就能连上数据库了么?

@wendal 数据库可以连上,用navicat可以连上,帐号密码也没有错的

换成最简单的SimpleDataSource来测试

来自炫酷的 NutzCN

一种可能性是,初始化大小60,耗时太久,然后等待时间设置为5秒,所以timeout了

来自炫酷的 NutzCN

@wendal 麻烦提供一下simpleDataSource的配置参数我

仅配置url,username,password

来自炫酷的 NutzCN

信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [147] milliseconds.
2016-09-14 16:33:12,349 [localhost-startStop-1] ERROR org.nutz.mvc.impl.NutLoading - Error happend during start serivce!
org.nutz.ioc.IocException: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jb1rpoka3pyhn|33b323c7, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jb1rpoka3pyhn|33b323c7, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A ResourcePool could not acquire a resource from its primary factory or source.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.lang.Lang.wrapThrow(Lang.java:157)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:105)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:181)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:199)
at com.venustech.tsoc.cupid.logging.LoggingProcessor.init(SourceFile:175)
at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:34)
at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:46)
at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:175)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:91)
at com.venustech.tsoc.CupidNutLoading.load(SourceFile:22)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:54)
at com.venustech.tsoc.CupidNutFilter.init(SourceFile:36)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jb1rpoka3pyhn|33b323c7, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jb1rpoka3pyhn|33b323c7, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A ResourcePool could not acquire a resource from its primary factory or source.
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:67)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:76)
... 28 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
... 30 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: Connections could not be acquired from the underlying database!
at org.nutz.lang.Lang.wrapThrow(Lang.java:141)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:154)
at org.nutz.dao.impl.NutDao.(NutDao.java:91)
... 35 more
Caused by: 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 org.nutz.trans.Trans.getConnectionAuto(Trans.java:252)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:96)
... 37 more
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)
... 40 more
九月 14, 2016 4:33:12 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jb1rpoka3pyhn|33b323c7, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jb1rpoka3pyhn|33b323c7, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A ResourcePool could not acquire a resource from its primary factory or source.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.lang.Lang.wrapThrow(Lang.java:157)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:109)
at com.venustech.tsoc.CupidNutLoading.load(SourceFile:22)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:54)
at com.venustech.tsoc.CupidNutFilter.init(SourceFile:36)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.ioc.IocException: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jb1rpoka3pyhn|33b323c7, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jb1rpoka3pyhn|33b323c7, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A ResourcePool could not acquire a resource from its primary factory or source.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.lang.Lang.wrapThrow(Lang.java:157)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:105)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:181)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:199)
at com.venustech.tsoc.cupid.logging.LoggingProcessor.init(SourceFile:175)
at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:34)
at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:46)
at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:175)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:91)
... 21 more
Caused by: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.dao.impl.NutDao'
by args: [
@(com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge13p9jb1rpoka3pyhn|33b323c7, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13p9jb1rpoka3pyhn|33b323c7, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/tsoc?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useLocalSessionState=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ])] becasue:
A ResourcePool could not acquire a resource from its primary factory or source.
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:67)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:76)
... 28 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
... 30 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: Connections could not be acquired from the underlying database!
at org.nutz.lang.Lang.wrapThrow(Lang.java:141)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:154)
at org.nutz.dao.impl.NutDao.(NutDao.java:91)
... 35 more
Caused by: 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 org.nutz.trans.Trans.getConnectionAuto(Trans.java:252)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:96)
... 37 more
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)
... 40 more

还是报c3p0啊

这种问题,自己详细检查,别人没法帮忙

添加回复
请先登陆
回到顶部