Monday 3 November 2014

Kill process running on particular port in Ubuntu

While running play framework by default it runs on port no 9000,
sometime if u try to run it gives error as following 

[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.reflect.InvocationTargetException
[error] Total time: 4 s, completed Nov 3, 2014 5:28:55 PM

This error occurred since there is already running process on port no 9000.

Solution :
#1.
Either run on different port number.
ex: sbt run 8000

  
#2.
Kill process from particular port number (in this case from 9000)
run following command
 netstat -plten |grep java

You will see following result
tcp6       0      0 :::10000                :::*                    LISTEN      1000       60672       3688/java       
tcp6       0      0 :::9000                 :::*                    LISTEN      1000       60673       3688/java

then run command 
 kill -9 3688

Additional: 
if want to see process with there respective process-id.
fuser -n tcp <port number>


No comments:

Post a Comment