S Singh
S Singh

Reputation: 1473

java.lang.Exception: Port 8083 already in use

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!

Upvotes: 11

Views: 31622

Answers (10)

Adil ALTUN
Adil ALTUN

Reputation: 71

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

Upvotes: 0

Gray
Gray

Reputation: 116908

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]

Upvotes: 13

Noor Syed
Noor Syed

Reputation: 630

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

Upvotes: 0

abinov
abinov

Reputation: 81

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.

Upvotes: 0

The Tomahawk
The Tomahawk

Reputation: 153

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.

Upvotes: 0

Benxamin
Benxamin

Reputation: 4820

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

Upvotes: 7

Angelo Fuchs
Angelo Fuchs

Reputation: 9941

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

Upvotes: 1

user147373
user147373

Reputation:

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.

Upvotes: 6

Averroes
Averroes

Reputation: 4228

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.

Upvotes: 0

RHT
RHT

Reputation: 5054

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.

Upvotes: 0

Related Questions