Tomcat、Invalid message received with signature、AjpMessage.processHeader Invalid message

简介: Tomcat、Invalid message received with signature、AjpMessage.processHeader Invalid message

工作中项目一直放在测试环境中测试,但最近在正式环境中,有一次与同事联调的过程中,Tomcat 服务器出现异常,百思不得其解,之前一直正常的 Tomcat 出现异常,服务器窗口不间断输出 org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635,但我并没有对服务器配置进行修改过,what?

如下为 Tomcat 服务器的报错信息

123-Jul-2019 14:28:43.711 信息 [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a 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.
23-Jul-2019 14:28:50.039 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory D:tomcatwebappsQYWeixinyh has finished in 9,907 ms
23-Jul-2019 14:28:50.086 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-17000"]
23-Jul-2019 14:28:50.101 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8096"]
23-Jul-2019 14:28:50.101 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 10852 ms
23-Jul-2019 14:28:50.148 严重 [ajp-apr-8096-exec-7] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-6] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-5] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-3] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-4] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-7] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-2] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-10] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-1] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-9] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-8] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
23-Jul-2019 14:28:50.164 严重 [ajp-apr-8096-exec-2] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 5635
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

自 Server startup in 10852 ms 启动之后,持续不间断的输出严重的报错信息,通过浏览器访问 Tomcat/conf/Server.xml 配置的端口也无法访问,通过报错信息追踪,问题产生于这一配置

<Connector port="8096" protocol="AJP/1.3" redirectPort="8443"/>

而在 Stack Overflow 中,对于 AjpMessage.processHeader 问题的记录并不多, 对于配置的修改则为将 AJP/1.3 替换为 HTTP/1.1,但这个修改对 5635 报错并没有起作用,反而会引起其他的报错信息。

对此,修改了如下配置便解决了一直输出端口严重错误的问题:

<Connector port="8096" protocol="AJP/1.3" address="127.0.0.1" redirectPort="8443"/>

添加 address 属性,将地址指向本地服务器,关于 address 属性,官方文档 也有具体说明,在默认的情况下,此端口将用于与服务器关联的所有IP地址,指定本地则免去暴露的危险,这个情况早在 Tomcat7 时就有出现,而此处使用 Tomcat8 也在启动时进行检测,避免该情况发生。

鉴于以上配置和今天遇到的一下log打印的错误,错误号各有不同

运行tomcat最后在窗口打印出   Invalid message received with signature 18245这个错误,只是写了一个简单的demo,最后百度了一通,说是Tomcat的Ajp端口8009,外网访问的原因,如果没有指定IP地址的话,默认是绑定任意地址,这样就导致外网也可以访问这个端口。因此出于安全考虑,我们需要增加这个address的设置,并且绑定到127.0.0.1,结果如下:<Connector port="8009" protocol="AJP/1.3" address="127.0.0.1" redirectPort="8443" />,修改的目录是tomcat下的conf/server.xml文件,里面找一下port=‘8009’的那一行,添加address="127.0.0.1"。

八月 19, 2020 3:56:01 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 356

八月 19, 2020 3:56:02 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 12420

八月 19, 2020 3:56:03 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 12300

八月 19, 2020 3:56:03 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 20304

八月 19, 2020 3:56:05 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 21582

八月 19, 2020 3:56:05 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 768

八月 19, 2020 3:56:06 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 17517

八月 19, 2020 3:56:07 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 14848

八月 19, 2020 3:56:08 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 17481

八月 19, 2020 3:56:08 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 19026

八月 19, 2020 3:56:09 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 256

八月 19, 2020 3:56:10 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 15392

八月 19, 2020 3:56:11 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 256

八月 19, 2020 3:56:11 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 90

八月 19, 2020 3:56:12 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 21365

八月 19, 2020 3:56:12 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 20853

八月 19, 2020 3:56:13 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 1284

八月 19, 2020 3:56:14 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 1025

八月 19, 2020 3:56:15 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 4609

八月 19, 2020 3:56:16 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 18501

八月 19, 2020 3:56:16 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 29556

八月 19, 2020 3:56:16 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 0

八月 19, 2020 3:56:17 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 0

八月 19, 2020 3:56:17 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 450

八月 19, 2020 3:56:17 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 17260

八月 19, 2020 3:56:18 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 15360

八月 19, 2020 4:02:02 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 5635

八月 19, 2020 5:53:00 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 5635

八月 19, 2020 5:53:00 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 18245

八月 19, 2020 5:53:01 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 5635

八月 19, 2020 5:53:01 下午 org.apache.coyote.ajp.AjpMessage processHeader

严重: Invalid message received with signature 18245

目录
相关文章
|
Java 应用服务中间件 Shell
tomcat启动报错 java.util.zip.ZipException: invalid CEN header (bad signature)
war包部署到tomcat里,启动时报错: Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.
13880 0
|
7月前
|
Java 应用服务中间件
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
1315 0
|
应用服务中间件
Tomcat请求特殊字符参数问题:Invalid character found in the request target. The valid characters are defined in
Tomcat请求特殊字符参数问题:Invalid character found in the request target. The valid characters are defined in
758 0
Tomcat请求特殊字符参数问题:Invalid character found in the request target. The valid characters are defined in
|
XML Java 应用服务中间件
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
294 0
|
应用服务中间件 Android开发
tomcat启动时报错ports are invalid,默认端口不要为-1
tomcat启动时报错ports are invalid,默认端口不要为-1
123 0
|
应用服务中间件 数据格式 JSON
Tomcat 8 Invalid character found in the request target. The valid characters are defined in RFC 3986
终极解决方案: Invalid character found in the request target. The valid characters are defined in RFC 3986 25-Aug-2018 11:27:27.
21193 0
|
2月前
|
安全 应用服务中间件 网络安全
Tomcat如何配置PFX证书?
【10月更文挑战第2天】Tomcat如何配置PFX证书?
232 7
|
2月前
|
存储 算法 应用服务中间件
Tomcat如何配置JKS证书?
【10月更文挑战第2天】Tomcat如何配置JKS证书?
358 4
|
4月前
|
网络协议 Java 应用服务中间件
tomcat配置域名及HTTPS
tomcat配置域名及HTTPS
|
4月前
|
Java 应用服务中间件 Windows
【应用服务 App Service】App Service 中部署Java项目,查看Tomcat配置及上传自定义版本
【应用服务 App Service】App Service 中部署Java项目,查看Tomcat配置及上传自定义版本