问题
I am getting binding exception while starting the Tomcat server. I tried to kill the process that which is using '80' as couple of processes are using it.
Getting error, while killing process id is '0':
ERROR: The process with PID 0 could not be terminated. Reason: This is critical system process. Taskkill cannot end this process.
How to fix this?
I don't need to use another port to run the tomcat server.
回答1:
Setting Tomcat to listen to port 80 is WRONG , for development the 8080 is a good port to use. For production use, just set up an apache that shall forward your requests to your tomcat. Here is a how to.
回答2:
The error:
java.net.BindException: Address already in use: JVM_Bind :80
means that another application is listening on port 80.
You can check which process is using this port by lsof
command, e.g. sudo lsof -i:80
. Then stop or kill it.
If won't help finding application running on the same port, the common mistake is the Tomcat misconfiguration.
For example by default Tomcat listens on port 8005 for SHUTDOWN command and if you set another Connector to listen on the same port, you'll get port conflict.
So please double check in server.xml
whether these ports are different:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8983" protocol="HTTP/1.1"
回答3:
PID 0 is the System Idle Process, which is surely not listening to port 80. How did you check which process was using the port?
You can use
netstat /nao | findstr "80"
to find the PID and check what process it is.
回答4:
Use the following command to find if your tomcat port is already in use,
netstat -a -b
netstat -a -o | findstr :port
For example
netstat -a -o | findstr :8080
Exception:
java.net.BindException: Address already in use: JVM_Bind:80
means that port 80 is configured by your Tomcat server and it is already used by some other application running on your computer. Please quit Skype if open or change the default port in Skype or other application's port to something other than 80. Or change the tomcat port to something else than 80(e.g. 8080 or 9090) in the server.xml file under the config folder of your tomcat installation directory.
Exception:
java.net.BindException: Address already in use: JVM_Bind
means you din't stop the tomcat server properly and you are trying to start the server again. In Eclipse, the solution for me was to remove the project from the servers tab and right click and run the project as Run on server. This added the project back to the Tomcat 7 and I din't get the BindException error. This was due to closing eclipse the last time you used without stopping the Tomcat server.
回答5:
I do a goofy mistake and It take me 2 hour to solve It.I mentioned it here for other persons may be help them.The mistake was I enable ssl connector and changed both https and http ports to same number .
回答6:
If you have some process listening on port 8080 then you can always configure tomcat to listen on a different port. To change the listener port by editing your server.xml
located under tomcat server conf
directory.
Search for Connector port="8080"
in server.xml and change the port number to some other port.
回答7:
The error:
Tomcat: java.net.BindException: Address already in use: JVM_Bind :80
suggests that the port 80 is already in use.
You may either:
- Try searching for that process and stop it OR
- Make your tomcat to run on different (free) port
See also: Deployment error:Starting of Tomcat failed, the server port 8080 is already in use
回答8:
I deleted my server and added it back. IT happened because I shut down the eclipse manually via task manager and it did not shut down the tomcat.
回答9:
C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\conf
Your Port ID in Server.xml File in Source folder is 8080. change the Port Number to 8081...etc
回答10:
I completely forgot that I had previously installed another version of Apache Tomcat, which was causing this problem. So, just try uninstalling the previous version. Hope it helps.
回答11:
Make sure /webapps/ROOT file is there and it has all the icons, WEB-INF, and index.jsp is in the folder.
When you startup Tomcat, it will run this code in <Tomcat-Directory>/conf/web.xml
directory:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
The location of index.jsp is in <Tomcat-Directory>/webapps/ROOT/index.jsp
Also, try running tomcat from the /bin directory using ./catalina.sh start
instead of ./startup.sh
. For some reason, ./startup.sh
isn't as reliable.
回答12:
I came across same issue. I was getting error Unable to open debugger port (127.0.0.1:63936): java.net.BindException "Address already in use: JVM_Bind" I tried above all option but any how its not resolved. Solution which worked for me is, I started the server and then stopped and again started in debug mode. then the server got started in debug mode.
回答13:
I faced this problem while working in a spring project with tomcat:
Address already in use: JVM_Bind
To resolve the issue I ran a shutdown.bat file in tomcat/bin folder.
来源:https://stackoverflow.com/questions/25742913/java-net-bindexception-address-already-in-use-jvm-bind-null80