SEVERE: Could not contact [localhost:[8005]]. Tomcat may not be running.

执行tomcat的关闭的脚本文件shutdown.sh报错

[root@tomcat tomcat]# ./bin/shutdown.sh 
# 报错信息中有一行为
SEVERE: Could not contact [localhost:[8005]]. Tomcat may not be running.
# 无法联系到8005端口
[root@tomcat tomcat]# netstat -tlnp |grep java
tcp6       0      0 :::8080                 :::*                    LISTEN      3994/java                    
tcp6       0      0 :::8009                 :::*                    LISTEN      3994/java  
# 确实没有监听到8005端口,8005端口是用来监听关闭tomcat的请求的

看了很多人的,都说是jdk包安装的bug,博主也去试了一下

[root@tomcat ~]# cd /usr/local/jdk8u241/jre/lib/security/
[root@tomcat security]# ls |grep java.security 
java.security
[root@tomcat security]# vim java.security 

找到
在这里插入图片描述
修改
在这里插入图片描述

[root@tomcat security]# source /etc/profile
# source使环境变量文件重新生效
[root@tomcat tomcat]# netstat -tlnp |grep java
netstat -tlnp |grep java
tcp6       0      0 :::8080                 :::*                    LISTEN      3994/java           
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      3994/java           
tcp6       0      0 :::8009                 :::*                    LISTEN      3994/java  

# 哈哈,这下能监听到8005端口了
# 尝试执行shutdown.sh 关闭tomcat

[root@tomcat tomcat]# ./bin/shutdown.sh 
Using CATALINA_BASE:   /data/application/tomcat
Using CATALINA_HOME:   /data/application/tomcat
Using CATALINA_TMPDIR: /data/application/tomcat/temp
Using JRE_HOME:        /usr/local/jdk8u241
Using CLASSPATH:       /data/application/tomcat/bin/bootstrap.jar:/data/application/tomcat/bin/tomcat-juli.jar
[root@tomcat tomcat]# 
# 搞定,感谢各位大佬,真的有用欸。哈哈,谢谢

你可能感兴趣的:(SEVERE: Could not contact [localhost:[8005]]. Tomcat may not be running.)