Tomcat not starting (throwing java.net.BindException: )

前端 未结 11 2146
礼貌的吻别
礼貌的吻别 2021-02-04 01:05

I have done the following settings to run a Java web project but somehow my Tomcat is not starting from Eclipse:

JAVA_HOME : C:\\Program Files\\Java\\jdk1.6.0_         


        
相关标签:
11条回答
  • 2021-02-04 01:33

    You should not have to change the server.port to fix this problem...

    Mac/Unix/Linux Users: If after you restart Tomcat, and this problem still exists, it is probably because Tomcat was shutdown improperly and there are resources still associated with it that are now locked. You can see the PIDs of those resources by running this command:

    lsof | grep tomcat
    

    Terminate those processes using:

    kill -15 <PID>
    

    This should fix your problem.

    Using the kill -15 command to TERM (-15) the process rather than SIGKILL (-9) is preferable. The -15 switch sends the process the signal to begin it's shutdown phases and clean up bounded resources.

    0 讨论(0)
  • 2021-02-04 01:36

    Try :http://localhost:8089 if it is not worked (or) Try this: Set:JRE_HOME : C:\Program Files\Java\jre1.5.0_11 (depend on your version of JRE) and add the C:\Program Files\Java\jre1.5.0_11 (depend on your version of JRE)\bin to path Eclipse-> go to windows preferences:server->RuntimeEnvironment remove added Server and Referesh and add new TomcatServer

    0 讨论(0)
  • 2021-02-04 01:37

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

    This means that some other process is already using this port. Could it be another Tomcat instance?

    0 讨论(0)
  • 2021-02-04 01:38

    This generally happens if the Connector / shutdown port of the tomcat is already being used. First, run the shutdown.bat (Sometimes we miss out that one instance of the tomcat is already running) Next, in the command prompt run

    netstat -aon | findstr 0.0:<your port number which is giving bind exception>
    

    To get the PID of the application that is currently using your port. Either kill that application or use some other port which is not listed when you run

    netstat -a -o -n
    
    0 讨论(0)
  • 2021-02-04 01:43

    TIL: Someone else on a server can start IIS on port 80 and not tell anyone.
    If you have your tomcat configured for the same port, it will also report this error.
    The port on IIS or tomcat will need to be changed.

    To modify the port in IIS:
    Administrative Tools | Internet Information Services (IIS) Manager
    Right Click on Default Web Site | Edit Bindings... Change Port

    -OR-

    To modify the port in Tomcat:
    Open conf\server.xml and update the port value in tag:

    <Connector port="80" protocol="HTTP/1.1"
        connectionTimeout="20000"
        redirectPort="8443"
        URIEncoding="UTF-8"/>
    

    Restart Tomcat

    Enjoy 2 web services.

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