Eclipse调用Tomcat出错

错误提示:The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports.

原因是是装Tomcat的时候server shutdown port没有设置成8005,而是-1,所以导致eclipse调不起来。

shutdown端口的意思是The command string that must be received via a TCP/IP connection to the specified port number, in order to shut down Tomcat.(为了关闭Tomcat,必须通过与指定端口号的TCP / IP连接接收的命令字符串。)

<Server port="8005" shutdown="SHUTDOWN">
tomcat 监听的关闭端口,就是说 这个端口负责监听关闭 Tomcat 的请求
当执行 shutdown.sh 关闭 tomcat 时就是连接 8005 端口执行 “SHUTDOWN” 命令;
由此,我们直接用 telnet 向 8005 端口执行 “SHUTDOWN”(要大写,小写没用)来关闭 tomcat,这也是正统的关闭方式,如果这个端口没被监听,那么 sh 脚本就无效了。

网上说这个端口这一无需认证,只要向这个端口发送SHUTDOWN命令就会把服务关了,所以有安全隐患。可能就是因为这个,所以安装的时候默认把shutdown的端口改为了-1

 

更改shutdown端口为8005,进入Tomcat文件的conf文件夹的server.xml中,修改其中shutdown的端口

posted @ 2019-11-22 16:34  roadwide  阅读(1303)  评论(0编辑  收藏  举报