服务在部署到tomcat启动时,有时会遇到Jvm_Bind的错误提示。这个是告诉我们,tomcat启动失败,错误原因为服务器的端口被占用了。一下几种方式解决一些常见的服务启动,端口被占用的情况:
1. 查看自己的tomcat启动端口号(默认是80,路径:tomcat安装路径\conf\server.xml),打开server.xml文件,如下是服务启动端口号
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector port="8012" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
查看是否有启动端口被占用,是否有其他服务占用了该端口,如果有,打开任务管理工具,将进程关闭掉,再启动tomcat。
2、同时启动多个tomcat,端口号冲突了,导致启动异常,同步骤1.
3、之前已经启动过该程序,后来由于IDE崩溃,导致服务未正常关闭,一直占用后台的进程中,此时如果再启动该服务的话,就会提示异常,可以找到tomcat安装目录下的bin目录,双击shutDown.bat(win操作系统后缀为.bat,linux操作系统后缀为.sh),关闭之后,再重启即可。
--------------------------------------------------------分割手----------------------------------------------------------
暂时还没发现其他的。如果哪位有其他的方法,还请在下面留言,大家相互学习