mysql dbcp maxactive_关于tomcat启动时的警告 :Property maxActive is not used in DBCP2, use maxTotal instead. ...

我们现在用的tomcat大概都是8.5 或是9.0,这些版本的tomcat内置的DBCP2,和以前老版本如tomcat 7的连接池不一样,7.0等老版本用的是DBCP。

tomcat 7等老版本中,内置连接池时 context.xml文件 的默认配置示例:

在老版本的tomcat里面关于允许的最大连接数用maxActive来表示,最大等待延用maxWait来表示

我们现在用的是新版本的tomcat,新版本内置的连接池已经升级了,所以如果我们继续使用这个配置就会出现如下图所示警告:

0d07c3d48ac5f3238f7a927311b204ef.png

警告原文如下:

七月 05, 2018 1:55:06下午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory [D:\learn\JavaWeb\apache-tomcat\apache-tomcat-9.0.7\webapps\day28_struts2_final]

七月05, 2018 1:55:06下午 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance

警告: Name= day28 Property maxActive is not used in DBCP2, use maxTotal instead. maxTotal default value is 8. You have set value of "100" for "maxActive"property, which is being ignored.

七月05, 2018 1:55:06下午 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance

警告: Name= day28 Property maxWait is not used in DBCP2 , use maxWaitMillis instead. maxWaitMillis default value is -1. You have set value of "10000" for "maxWait"property, which is being ignored.

七月05, 2018 1:55:06下午 org.apache.jasper.servlet.TldScanner scanJars

信息: At least one JAR was scannedfor TLDs yet contained no TLDs. Enable debug logging for this logger fora complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

七月05, 2018 1:55:07下午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory [D:\learn\JavaWeb\apache-tomcat\apache-tomcat-9.0.7\webapps\day28_struts2_final] has finished in [1,469] ms

这个警告其实已经把话说的很明白了,既然8.5,9.0tomcat内置的是DBCP2,已经使用 maxTotal来取代maxActive、使用maxWaitMillis来取代maxWait,

因此我们只需要将自己的配置文件中的maxActive替换成maxTotal、maxWait替换成maxWaitMillis即可。

警告消失了:

七月 05, 2018 3:26:15下午 org.apache.catalina.startup.HostConfig undeploy

信息: Undeploying context [/day28_struts2_final]

七月05, 2018 3:26:15下午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory [D:\learn\JavaWeb\apache-tomcat\apache-tomcat-9.0.7\webapps\day28_struts2_final]

七月05, 2018 3:26:16下午 org.apache.jasper.servlet.TldScanner scanJars

信息: At least one JAR was scannedfor TLDs yet contained no TLDs. Enable debug logging for this logger fora complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

七月05, 2018 3:26:16下午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory [D:\learn\JavaWeb\apache-tomcat\apache-tomcat-9.0.7\webapps\day28_struts2_final] has finished in [1,087] ms

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值