Easy to handle the port is occupied

Source: Internet
Author: User
Tags jboss

Most recently, with Tomcat and JBoss, where the process appears to have a port occupied, a port is occupied, and Tomcat or JBoss starts out with a bunch of bugs, with a particularly obvious standard: caused by: java.lang.Exception:Port8083 already in the use. or caused by:java.net.BindException:Address already in Use:jvm_bind, You don't have to doubt it, this must be the port is occupied by other programs. Teach you three strokes, easy to handle. The port is occupied.

first recruit: Close the use of the port of the program first open cmd, open the method is very simple, in the Start menu directly input can be. You can also press Win+r to open the run, and then enter CMD.


Enter the following command in the DOS command to query the port number being used and the program that uses it.

Command: Netstat-ano


You can also filter out the port so that you don't need to find one, command: NETSTAT-ANO|FINDSTR 8080


Content analysis:
The previous program occupies the process, followed by the colon is the port we are looking for. Find 8080, because I have been solved, so the picture here can not be given to everyone.


See behind there is a PID, and then take up the 8080-port PID number down.


Right-click on the taskbar-select Task Manager.


Click on the selection in the menu bar-show the front button. Then, hit the tab to the Process column. This is where you can see the PID number that the program occupies.


Find just the query to occupy the 8080-port of the process, the end of the OK.


Second trick: Modify Tomcat's configuration file

For example: D:/tomcat7.0.00/conf/server.xml

<connector port= "8080" maxhttpheadersize= "8192"

maxthreads= "minsparethreads=" maxsparethreads= "75"

Enablelookups= "false" redirectport= "8443" acceptcount= "100"

connectiontimeout= "20000" disableuploadtimeout= "true"/>

Change the port in port= "8080" to a port that is not occupied.

the third trick: Modifying the port number in Eclipse

Double-click Tomcat, and then modify:


After the modification is complete, save the changes and restart Tomcat.

      The first approach seems a bit complicated but fundamentally solves the problem, the second and third methods, and one test to test which interface is not occupied. This is only a stopgap, I do not recommend. There is a saying: The method is always more than the problem. One port is occupied and there are three different solutions. These three methods are not only for Tomcat, but also for server JBoss. Different servers, the same problem, the solution is the same.

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.