Common causes and solutions for Tomcat (8005,8080,8009) port occupancy problems

Source: Internet
Author: User
Tags server port tomcat server

In Enterprise Eclipse, when you are ready to run a page or servlet after you have started a Tomcat server, there are times when you have a problem with Tomcat server port usage:
"Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are. The server may already is running in another process, or a system process may is using the port. To start this server would need to stop the other process or change the port number (s).



The error message is that the three ports required for Tomcat to run are occupied by the program.
I have personally encountered the following reasons:

situation One: Click to run without selecting the tab for the page or servlet window
The situation is shown below:




Carefully observed that the left figure does not actually select the servlet window to run the label, because the label is white, click on the Run button is equivalent to start a server process, the port of course is the original that has started the server accounted for. The right side of the servlet window tag is blue, the description has been selected, click on the Green Run button after the natural is to load this servlet into the server that has started running, so there will not be like that port occupancy.


situation Two: There are tomcat in all two places on the hard drive.
Here is another situation I have encountered, previously in D disk installed a Tomcat, and later because of a period of time is not how to use, it is ignored. Then again, when I started the exercise, another tomcat was installed in the C disk, and in eclipse it was the tomcat that chose the C disk by default. The tragedy is, because the Tomcat in D was set to boot up, so the port was first taken over by it. Therefore, when you start Tomcat (c disk) in Eclipse, there is an error indicating that the port is occupied.



Later, after you remove the Tomcat from the D disk, you can run the page normally in Eclipse.

Case Three: (8005,8080,8009) at least one of the three ports is occupied by other programs
It's hard to see it all at once, but it's just a matter of figuring out which program is taking up these ports. You can use the "netstat-abn" command in the console to view the ports that the running program occupies and related information:



As you can see, the "Javaw.exe" program takes up 8009 and 8080 ports and ends it in the resource manager.



Of course, there may be other causes. Explore it slowly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.