1

I have downloaded NetBeans-8.0.1-windows and MySQL 5.0 setup and tomcat 8.5 and successfully installed on win 7 OS.

Now I am trying to start Apache Tomcat but it always shows error like

Starting of Tomcat failed, the server port 8080 is already in use.

Please help to solve this issue. I have downloaded mysql-connector-java-8.0.17.zip and unzipped it.

shital dhanba
  • 11
  • 1
  • 6
  • help me to solve this issue :) – shital dhanba Aug 18 '19 at 09:03
  • Possible duplicate of [Deployment error:Starting of Tomcat failed, the server port 8080 is already in use](https://stackoverflow.com/questions/5310945/deployment-errorstarting-of-tomcat-failed-the-server-port-8080-is-already-in-u) – rjdkolb Aug 18 '19 at 16:47
  • Instead of worrying about what other process is using port 8080, just change Tomcat to use a different port: [1] Use **netstat** to verify that your new port number is free. For example, to verify that port 54321 is available submit **netstat -ano | findstr 54321** and if no output is displayed then 54321 is available. If output is returned then it is in use, so just pick a different number. [2] See [How to change Tomcat default port?](https://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/) for details on how to edit Tomcat's **server.xml** to change the port number. – skomisa Aug 21 '19 at 02:57
  • Note that just blindly killing the process currently using port 8080 is not necessarily a good idea, unless you understand why it is being used. If you don't then using an alternative port to 8080 for Tomcat is a better approach. – skomisa Aug 21 '19 at 03:03
  • Check https://stackoverflow.com/a/48162646/3346408 link to change port 8080 to another – Rahul Bhawar Oct 18 '19 at 10:21

1 Answers1

2

First, try to check if the port 8080 is on use:

Run command-line as an Administrator. Then run the below mention command.

netstat -ano | findstr :8080

enter image description here

The red-colored circled area shows the PID (process identifier). If you are getting something like the above image, kill the running processes on that port.

Then you execute this command after identifying the PID.

taskkill /PID <typeyourPIDhere> /F

enter image description here

P.S. Run the first command again to check if the process is still available or not. You'll get an empty line if the process is successfully ended.

The answer is taken from the following link: http://www.callstack.in/tech/blog/windows-kill-process-by-port-number-157

  • Thank you. I tried it but it doesn't working. when I killed port number 8080 then automatically that port number is again using by another PID. – shital dhanba Aug 18 '19 at 09:16
  • when I start Apache Tomcat then it always showing error like " Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed " and " Address already in use: bind " – shital dhanba Aug 18 '19 at 09:19
  • 1
    check out this answer, it might help https://stackoverflow.com/a/34259707/5959252 –  Aug 18 '19 at 09:26
  • how to do these steps in netbeans?? In the above link, eclipse is used but I am using Netbeans 8.0.1. – shital dhanba Aug 18 '19 at 09:32
  • I also tried to change port numbers then also it doesn't worked. Tools --> Servers --> Server Port and Shutdown port. – shital dhanba Aug 18 '19 at 09:34
  • 2
    after running "netstat -ano | findstr :8080" in command-line and getting PID, check which service is running in that port using task manager. –  Aug 18 '19 at 10:48
  • 1
    Another approach is: Close the IDE and check Task Manager - kill any javaw process running. –  Aug 18 '19 at 10:49
  • 1
    Have you tried changing tomcat server's port to available one? –  Aug 18 '19 at 13:55