user3505775
user3505775

Reputation: 339

java.net.BindException: Address already in use: bind

I get an error using glassfish like this : java.net.BindException: Address already in use: bind, but i think i have changed the port of the server like this:

enter image description here

And i think i have changed the port to be 9999. But nothing is effected. This is all port was used on my computer.

how to fix it?, i see the server port using 8080. I think it makes the port depedency with port url. is it true and how to fix it? enter image description here

Upvotes: 4

Views: 29506

Answers (3)

yogesh joshi
yogesh joshi

Reputation: 21

Open domain.xml inside ../glassfish4/glassfish/domains/domain1/config/ and search for 8080 and change it to something else for the main http port.

Upvotes: 1

叶为正
叶为正

Reputation: 81

My solution is as follows: open the task manager, find the java.exe process, close it, or restart the computer.

Upvotes: 0

unwichtich
unwichtich

Reputation: 13857

As the error message clearly says: The port is in use.

The netstat output shows there is a connection to BNI-PC:4848. This is the port the Glassfish Admin Frontend should run on, this means there is already an instance of Glassfish running on your computer.

Also, if something is running on port 8080, Glassfish won't start with the default settings.

Changing the debug port doesn't help you, this has nothing to do with the other two ports.

You should close Eclipse and then kill all remaining Java processes via the task manager to solve the problem.

If you really want to change the ports, make sure that Glassfish is not running, open domain.xml inside ../glassfish4/glassfish/domains/domain1/config/ and search for 8080 to change the main http port and search for 4848 to change the Glassfish Admin UI port.

Hint: You can use netstat -a -b (required admin rights) to see which process is using the ports.

Upvotes: 5

Related Questions