I am getting exception on console which is:
java.lang.Exception: Port 8083 already in use.
How to resolve this exception? If I will get which service is using 8083 port then I can stop that service and in this way I can get over this problem.
Thanks for your help!
java.lang.Exception: Port 8083 already in use.
The error means that another application already has that port bound so that you can't use it. Typically it means that a server is running (or is exiting) but still has the specific port open. Often this error is given when you are trying to shutdown one server and bring up the new version but the first server isn't total down when the new one is started. You need to find the server in question and you may have to kill it using kill -9
or something.
A good tool to find out which application has the port open is lsof
. This should work under most Unixes (Linux) and MacOSX at least.
lsof -i :8083
lsof
is for LiSting the Open Files on a system but the -i
option is for internet addresses:
-i [i] This option selects the listing of files any of whose Internet
address matches the address specified in i.
[46][protocol][@hostname|hostaddr][:service|port]
The exception is thrown because you are trying to bind to a port that is already in use by another process.
Using netstat -a
from the command line will show you a list of open ports and the process that's using them. Than you can kill it.
Update:
On Windows you can use netstat -ao
to list all the in use ports along with the Process ID that owns the connection.
On Linux you can use netstat -p
to list the process id/program name.
I get this with JBoss server every once in a while. It's not intuitive that you would need to restart Java, but the above methods didn't work.
For Mac OS X:
SLOW
FAST
ps aux | grep 'java'
to list the current Java processes and their IDs.
kill -9 process_id_goes_here
The exception means: there is already a open Port '8083'. You solve it by either stopping that service or by using a different port yourself.
I would guess that your own service is already running when you try to start it, so stop the old instance before starting the new one.
(I know Tomcat runs on 8080 and sometimes people change that to 8083, but its impossible for anyone to know what service runs on your machine using that port.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With