블로그 이미지
잡초 개발자의 좌충우돌 이야기 yysvip

카테고리

분류 전체보기 (211)
Java Programing (24)
Web Programing (20)
Database (36)
Tool (46)
까칠한 IT (27)
까칠한 정보 (42)
까칠한 Strory (16)
까칠한 Project (0)
Total1,164,621
Today23
Yesterday4,565

달력

« » 2018.12
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

공지사항

How to solve Address or Port already in use error in java?

  까칠한 남자 Strory       yysvip.tistory.com       잡초 개발자 까찰한 쑤의 좌충우돌 개발 이야기

 

 

java.net.BindException: Address already in use: JVM Bind is one of the most popular error among java developers and guys who do socket programming in some other language too. But with respect to java this error is much familiar with socket programming and during web development. This error happens for ports 80 (HTTP) , 1098 (RMI) when it is used by other applications that is running on the same PC or server. So I am going to explain how to debug and solve this problem. 

 

 

Step I : Finding the ports that are in use:

 

1. You can use the tool CurrPorts to solve this problem. You can read about the tool in my previous post How to find open ports in your PC?

 

2. If you are using windows XP you can use the netstat command to view which processing is occupying the port. If you use Windows 2000 then you cannot use the ‘ netstat -o ‘ in your netstat command which tells you the process ID that is using the port. So in windows 2000 use the tool CurrPorts which is free.

 

eg) netstat -ano
 

 

Note:

 

If you have problem with port 1098 then check whether outlook or firefox is currently in use and close the same to free the port. This is just an example and for a better report you can use the tools mentioned above.

 

Step II : Free up the port:


You can free up the port by 3 ways,


1. If you use CurrPorts tool then you can find the application that is using it and you can close it down or kill the process by right clicking in the tool.

2. In windows you can use the command ‘ taskkill /PID 828 ‘ to kill the appropriate process.

3. Making your program to use a different port. For instance if you are encountering this error with JBOSS Application server for port 80, then you can go to server.xml in the appropriate directory say server/default/deploy/jbossweb-tomcatXX.sar/server.xml and change the port to 8080 to avoid the conflict. In case of Tomcat look for server.xml in the conf directory

 

>> 원본보기 <<

 

 

Posted by yysvip

최근에 달린 댓글

최근에 받은 트랙백

글 보관함