java.lang.Exception: Port 8083 already in use
Asked Answered
A

10

11

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!

Antoinette answered 7/12, 2011 at 13:40 Comment(3)
How are you getting this exception? And what operating system are you using? We can't guess here.Kneepan
Try netstat -aCommon
Please consider accepting my answer below if it was helpfulGunboat
G
13

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]
Gunboat answered 7/12, 2011 at 13:54 Comment(0)
W
7

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

  1. Open Activity Monitor.
  2. Filter by "java"
  3. Quit any processes (usually just one).
  4. Restart your server.

FAST

ps aux | grep 'java' to list the current Java processes and their IDs.

kill -9 process_id_goes_here

Whited answered 11/3, 2013 at 21:22 Comment(0)
L
6

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.

Lundt answered 7/12, 2011 at 13:44 Comment(4)
On what OS does netstat -a show you the processes that have the port open?Gunboat
@Gunboat I think there is a -p flag that you could use to show the name of the processCommon
Did not know that. That works under Linux but not MacOSX nor OpenBSD. Make sure you edit your answer to include the -p.Gunboat
The -p flag for windows allows the protocol to be specified. I'll have to login to a linux machine to check the usage thereLundt
P
1

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.)

Politi answered 7/12, 2011 at 13:44 Comment(0)
P
0

Either terminate the process which is using port 8083 or configure your application to run on another port. Smart applications try to use an alternative port automatically.

Pyromorphite answered 7/12, 2011 at 13:44 Comment(0)
T
0

If you are starting a server for deploying your application it may happen that any other process or application is using that port. Outlook, Skype or other applications do it sometimes at my job. Use a program like CPorts for kill that connection and restart your server.

Tonsillotomy answered 7/12, 2011 at 13:46 Comment(0)
C
0

There is another possibility: you may be trying to bind to the wrong IP address -- JBoss will report this as being unable to bind to the port.

Check your -b option against your run.sh and ensure that it is either 0.0.0.0 or the IP or hostname of the server.
- If it's 0.0.0.0, then the problem is that the port is in use.
- If it's the IP, verify that it is the correct ip using /sbin/ifconfig (or ipconfig on Windows)
- If it's the hostname, then run
  telnet hostname_here
  and verify that the IP address that is resolves to is the correct IP address.

I had this exact issue and I found that someone had put the wrong IP address in the /etc/hosts file. Once I fixed the file, JBoss started fine.

Colby answered 11/1, 2014 at 11:9 Comment(0)
M
0

In Eclipse, if you got this error, it means there are one or two Eclipse instances using the same port.

The solution is go to your operating system's process manager and kill the Eclipse and java processes.

Maniple answered 6/2, 2015 at 5:29 Comment(0)
A
0

Make sure the ports are different on two JBOSS instances in the file conf/bindingservices.beans/META-INF/bindings-jboss-beans.xml

There are around 10 ports to change

Afterbirth answered 8/4, 2015 at 20:36 Comment(0)
O
0

If you are using windows operating system, you can follow these commands in command prompt:

  • netstat -ano | findstr :8083

response of the netstat -ano | findstr :8083 command

After typing the command, we reach the listening number (in this example listening number: 3680).

After reaching this number, We can write this command:

  • taskkill /PID 3680 /F

response of the taskkill /PID 3680 /F command

Odontoid answered 22/8, 2023 at 15:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.