java.net.BindException: Address already in use: JVM_Bind

后端 未结 2 357
無奈伤痛
無奈伤痛 2020-12-12 06:53

I have 2 tomcats running in my server

one Tomcat 7 and the other is tomcat 8, the configuration file server.xml for the first is:

           

        
相关标签:
2条回答
  • 2020-12-12 07:21

    You need to have different ports for the tomcat instance including but not limited to the connector port, ajp port, shutdown port. And once you have that the error would go away.

    However it is good practice to have the same tomcat binary being used to run multiple tomcat instances using the CATALINA_BASE variable. More details are in the link below. See the section on running multiple instances. Also note that this same RUNNING.txt file would also be in the tomcat binaries and you can also review it there.
    http://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt

    0 讨论(0)
  • 2020-12-12 07:39
    <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />
    

    8080 is the port number on which server will run. Only one server (which you will start first) would run. Other one will throw Jvm Bind Exception.

    So, change the port number so that they are unique.

    One you run first server then use netstat command to see the ports which are in use.

    0 讨论(0)
提交回复
热议问题