• 启动Tomcat的时候8080被占用


    异常来源:启动Tomcat服务器报错:

         Several ports (8080, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

    这个时候,有两种办法去解决:

    方法一:关闭掉8080端口的进程:

    先打开你的cmd命令(电脑按住Win+R键),然后在code里敲 netstat -ano|findstr 8080或8009(哪个端口被占用,就输入哪个端口号,看我的截图是8080端口号).

    还有另外一种 输入: netstat   -ano

    展示出所有的,找到8080端口,pid为12064.

    可以在任务管理器找到pid为12064的进程直接关闭,或者在cmd中输入“taskkill /pid 编号 /f”

     比如我这个,就是直接输入taskkill /pid 12064 /f 就可以直接关闭这个进程。

     

    方法二:改变你tomcat启动的端口号,比如你现在为8080,但是端口号被占用了。

    修改Tomcat的配置文件。
    例如:C:/tomcat5.5.25/conf/server.xml
     <Connector port="8080" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" redirectPort="8443" acceptCount="100"
                   connectionTimeout="20000" disableUploadTimeout="true" />

    Connector 节点,将port="8080"中的端口改为一个没有被占用的端口。

    ----------------------------------------------------------------------

    以上方法使用后,重新打开tomcat就可以使用了。。。

  • 相关阅读:
    滚动计算基础知识
    Javascript继承
    提取URL字符串的搜索字符串中的参数
    C++编程练习(13)----“排序算法 之 堆排序“
    常见网络端口 和 常见网络协议
    TCP协议中的三次握手和四次挥手(图解)
    C++编程练习(14)-------“单例模式”的实现
    编程练习------C/C++分别实现字符串与整数的转换
    IPv4地址学习总结
    C/C++中的联合体
  • 原文地址:https://www.cnblogs.com/jianshuai520/p/9772484.html
Copyright © 2020-2023  润新知