本地运行没问题的项目在Tomcat持续运行一段时间后报错的部分解决办法

遇到的这些问题均为项目在本地运行很正常,发布在服务器上后出现的各种报错。

报错信息:

严重[ajp-nio-8009-exec-1] org.apache.coyote.ajp.AjpMessHeader Invalid received signature [18245]

信息[http-nio-8080-exec-6] org.apache.coyote.tp11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged level

解决方法:

在Tomcat的server.xml中将<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />注释掉。

找到<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>这个标签,添加maxHttpHeaderSize="8192"这一属性,这里顺便把端口改成了8001,8080端口不知为什么总是报一些莫名其妙的错误。

报错信息:

SQLException com.mysql.jdbc.exception.jdbc4.CommunicationException:The last packet successfully received from the server was xxx milliseconds ago. The last packet sent successfully to the server was xxx milliseconds ago, is longer than the server configured value of 'wait_timeout'...

解决方法:

在MySQL的my.ini中添加wait_timeout=数值,这里的数值为秒数,设置完后一定要重启MySql,否则无效,在连接数据库的地址后添加?autoReconnect=true&autoReconnectForPools=true

报错信息(这个在本地运行也会马上报错):

Establishing SSL connection without server's identityverification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+requirements SSL connection must be established by default if explicit optionisn't set. For compliance with existing applications not using SSL theverifyServerCertificate property is set to 'false'. You need either toexplicitly disable SSL by setting useSSL=false, or set useSSL=true and providetruststore for server certificate verification.

解决方法:

在连接数据库的地址后添加?useSSL=false

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值