NutzCN Logo
问答 连接池maxAction数量超过限制
发布于 2581天前 作者 efraiser 2513 次浏览 复制 上一个帖子 下一个帖子
标签:

动态的创建连接,但是暂时只有一个连接为什么会报错说超过最大数量。
下面是我写的方法
public static DaoUp getNewConnect(String dbNo) {
DaoUp daoUp = null;
if (daoUpMap.get(dbNo) != null) {
return daoUpMap.get(dbNo);
}else {
try {
SysDbUrlDao sysDbUrlDao = Mvcs.getIoc().get(SysDbUrlDao.class, "sysDbUrlDao");
if (sysDbUrlDao != null) {
SysDbUrl sysDbUrl = sysDbUrlDao.fetch(dbNo);
DruidDataSource ds = new DruidDataSource();
ds.setDriverClassName(sysDbUrl.getDriver());
ds.setUrl(sysDbUrl.getUrlStr());
ds.setUsername(sysDbUrl.getUserName());
ds.setPassword(sysDbUrl.getPassword());
ds.setMaxWait(4000);
//ds.setRemoveAbandoned(true);
ds.setMaxActive(2);
//ds.setRemoveAbandonedTimeout(8);
ds.getConnection();
daoUp = new DaoUp(dbNo){
};
daoUp.setDataSource(ds);
daoUpMap.put(dbNo, daoUp);
return daoUp;
}else {
return null;
}
} catch (Exception e) {
e.printStackTrace();
}
return daoUp;
}
报错信息
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:122)08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT
* FROM MODEL WHERE id=?
| 1 |
|----------------------------------|
| 0bce9561924b46bf96bb52eff4e08dab |
For example:> "SELECT * FROM MODEL WHERE id='0bce9561924b46bf96bb52eff4e08dab
'"

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica

torBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:625)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
int.java:2522)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:2511)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 400
0, active 8, maxActive 8
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDat
aSource.java:1139)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataS
ource.java:960)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:940)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:930)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:102)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
... 51 more
org.nutz.dao.DaoException: com.alibaba.druid.pool.GetConnectionTimeoutException:
wait millis 4000, active 8, maxActive 8
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:78)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:219)
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:197)
at org.nutz.dao.impl.NutDao.execute(NutDao.java:967)
at com.efraiser.ews.action.AppModelAction.getModelData(AppModelAction.ja
va:242)
at com.efraiser.ews.action.AppModelAction.getAppModelData(AppModelAction
.java:158)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvok
eProcessor.java:25)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor
.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFilt
ersProcessor.java:40)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.j
ava:113)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcess
or.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(
UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutServlet.service(NutServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at com.efraiser.filter.TokensFilter.doFilter(TokensFilter.java:64)
08:58:48 [DEBUG] org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] pat
h=/appModel/getAppModelData : AppModelAction.getAppModelData(...)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
08:58:48 [DEBUG] org.nutz.ioc.impl.NutIoc - Get 'appModelAction'<class com.efrai
ser.ews.action.AppModelAction>
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at com.efraiser.filter.CorsFilter.doFilter(CorsFilter.java:33)
08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM MODEL
WHERE id=?
| 1 |
|----------------------------------|
| f0885644f05440c797339de1b51aa727 |
For example:> "SELECT * FROM MODEL WHERE id='f0885644f05440c797339de1b51aa727
'"
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:625)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
int.java:2522)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:2511)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 400
0, active 8, maxActive 8
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDat
aSource.java:1139)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataS
ource.java:960)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:940)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:930)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:102)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
... 51 more
org.nutz.dao.DaoException: com.alibaba.druid.pool.GetConnectionTimeoutException:
wait millis 4000, active 8, maxActive 8
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:78)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:219)
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:197)
at org.nutz.dao.impl.NutDao.execute(NutDao.java:967)
at com.efraiser.ews.action.AppModelAction.getModelData(AppModelAction.ja
va:242)
at com.efraiser.ews.action.AppModelAction.getAppModelData(AppModelAction
.java:158)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvok
eProcessor.java:25)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor
.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFilt
ersProcessor.java:40)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.j
ava:113)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcess
or.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(
UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutServlet.service(NutServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at com.efraiser.filter.TokensFilter.doFilter(TokensFilter.java:64)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at com.efraiser.filter.CorsFilter.doFilter(CorsFilter.java:33)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:625)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
int.java:2522)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:2511)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 400
0, active 8, maxActive 8
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDat
aSource.java:1139)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataS
ource.java:960)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:940)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:930)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:102)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
... 51 more
08:58:48 [DEBUG] org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] pat
h=/appModel/getAppModelData : AppModelAction.getAppModelData(...)
08:58:48 [DEBUG] org.nutz.ioc.impl.NutIoc - Get 'appModelAction'<class com.efrai
ser.ews.action.AppModelAction>
08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM MODEL
WHERE id=?
| 1 |
|----------------------------------|
| f0885644f05440c797339de1b51aa727 |
For example:> "SELECT * FROM MODEL WHERE id='f0885644f05440c797339de1b51aa727
'"
08:58:48 [DEBUG] org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] pat
h=/appModel/getAppModelData : AppModelAction.getAppModelData(...)
08:58:48 [DEBUG] org.nutz.ioc.impl.NutIoc - Get 'appModelAction'<class com.efrai
ser.ews.action.AppModelAction>
08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM MODEL
WHERE id=?
| 1 |
|----------------------------------|
| 0bce9561924b46bf96bb52eff4e08dab |
For example:> "SELECT * FROM MODEL WHERE id='0bce9561924b46bf96bb52eff4e08dab
'"

13 回复

用插入代码按钮重新贴,分段插入代码啊

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:122)08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT
 * FROM MODEL  WHERE id=?
    |                                1 |
    |----------------------------------|
    | 0bce9561924b46bf96bb52eff4e08dab |
  For example:> "SELECT * FROM MODEL  WHERE id='0bce9561924b46bf96bb52eff4e08dab
'"

        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
956)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:423)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1079)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
int.java:2522)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:2511)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 400
0, active 8, maxActive 8
        at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDat
aSource.java:1139)
        at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataS
ource.java:960)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:940)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:930)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:102)
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
        ... 51 more
org.nutz.dao.DaoException: com.alibaba.druid.pool.GetConnectionTimeoutException:
 wait millis 4000, active 8, maxActive 8
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:78)
        at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:219)
        at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:197)
        at org.nutz.dao.impl.NutDao.execute(NutDao.java:967)
        at com.efraiser.ews.action.AppModelAction.getModelData(AppModelAction.ja
va:242)
        at com.efraiser.ews.action.AppModelAction.getAppModelData(AppModelAction
.java:158)
        at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvok
eProcessor.java:25)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor
.java:33)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFilt
ersProcessor.java:40)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.j
ava:113)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcess
or.java:27)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(
UpdateRequestAttributesProcessor.java:15)
        at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
        at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
        at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
        at org.nutz.mvc.NutServlet.service(NutServlet.java:66)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at com.efraiser.filter.TokensFilter.doFilter(TokensFilter.java:64)
08:58:48 [DEBUG] org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] pat
h=/appModel/getAppModelData : AppModelAction.getAppModelData(...)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
08:58:48 [DEBUG] org.nutz.ioc.impl.NutIoc - Get 'appModelAction'<class com.efrai
ser.ews.action.AppModelAction>
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at com.efraiser.filter.CorsFilter.doFilter(CorsFilter.java:33)
08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM MODEL
 WHERE id=?
    |                                1 |
    |----------------------------------|
    | f0885644f05440c797339de1b51aa727 |
  For example:> "SELECT * FROM MODEL  WHERE id='f0885644f05440c797339de1b51aa727
'"
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
956)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:423)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1079)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
int.java:2522)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:2511)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 400
0, active 8, maxActive 8
        at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDat
aSource.java:1139)
        at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataS
ource.java:960)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:940)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:930)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:102)
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
        ... 51 more
org.nutz.dao.DaoException: com.alibaba.druid.pool.GetConnectionTimeoutException:
 wait millis 4000, active 8, maxActive 8
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:78)
        at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:219)
        at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:197)
        at org.nutz.dao.impl.NutDao.execute(NutDao.java:967)
        at com.efraiser.ews.action.AppModelAction.getModelData(AppModelAction.ja
va:242)
        at com.efraiser.ews.action.AppModelAction.getAppModelData(AppModelAction
.java:158)
        at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvok
eProcessor.java:25)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor
.java:33)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFilt
ersProcessor.java:40)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.j
ava:113)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcess
or.java:27)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(
UpdateRequestAttributesProcessor.java:15)
        at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
        at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
        at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
        at org.nutz.mvc.NutServlet.service(NutServlet.java:66)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at com.efraiser.filter.TokensFilter.doFilter(TokensFilter.java:64)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at com.efraiser.filter.CorsFilter.doFilter(CorsFilter.java:33)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
956)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:423)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1079)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
int.java:2522)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:2511)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 400
0, active 8, maxActive 8
        at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDat
aSource.java:1139)
        at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataS
ource.java:960)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:940)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:930)
        at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.
java:102)
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
        ... 51 more
08:58:48 [DEBUG] org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] pat
h=/appModel/getAppModelData : AppModelAction.getAppModelData(...)
08:58:48 [DEBUG] org.nutz.ioc.impl.NutIoc - Get 'appModelAction'<class com.efrai
ser.ews.action.AppModelAction>
08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM MODEL
 WHERE id=?
    |                                1 |
    |----------------------------------|
    | f0885644f05440c797339de1b51aa727 |
  For example:> "SELECT * FROM MODEL  WHERE id='f0885644f05440c797339de1b51aa727
'"
08:58:48 [DEBUG] org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] pat
h=/appModel/getAppModelData : AppModelAction.getAppModelData(...)
08:58:48 [DEBUG] org.nutz.ioc.impl.NutIoc - Get 'appModelAction'<class com.efrai
ser.ews.action.AppModelAction>
08:58:48 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM MODEL
 WHERE id=?
    |                                1 |
    |----------------------------------|
    | 0bce9561924b46bf96bb52eff4e08dab |
  For example:> "SELECT * FROM MODEL  WHERE id='0bce9561924b46bf96bb52eff4e08dab
'"

前台有多个人在请求同样的方法

wait millis 4000, active 8, maxActive 8

你代码里面写的是2, 日志里面是8,对不上

而且呢, 不是报链接数过多

方法里是为了快速重新错误改的

反而是连接数太少,忙不过来,导致等待超时了, 改成maxActive 改成50

这个是什么造成的

改成50之后要出现过这样的问题

活跃连接8,允许最大连接8个, 当前线程等了4000ms还拿不到连接,所以报错

改成50之后也出现过这样的问题

那就继续加嘛

明白了,谢谢兽总

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