GlassFish: There is a process already using the server port

11,763

I ended up modifying /etc/hosts to make it work.

Before:

127.0.0.1      localhost localhost.localdomain localhost4 localhost4.localdomain4
::1            localhost localhost.localdomain localhost6 localhost6.localdomain6

After:

199.192.240.10 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1            localhost localhost.localdomain localhost6 localhost6.localdomain6

I'm not really sure why I needed to do that, but it worked.

Disclaimer: This isn't really my IP address - just used it for this example.

Share:
11,763

Related videos on Youtube

Steve
Author by

Steve

Updated on September 18, 2022

Comments

  • Steve
    Steve over 1 year

    I'm trying to run GlassFish 3.1.1 on Centos 6 in the Joyent cloud. No matter what I set the admin port to in glassfish/domains/domain1/config/domain.xml, when attempting to start it says:

    There is a process already using the admin port XXXXX -- it probably is another instance of a GlassFish server.

    I've checked netstat and /etc/services and tried dozens of different ports, but to no avail. It just flat out says that every port I try is taken.

    Ideas?

    • David Schwartz
      David Schwartz about 12 years
      GlassFish reports any bind failure with this message. You should treat it as just "bind to port XXXXX failed for some reason".
  • Steve
    Steve about 12 years
    This is a fresh Joyent Cloud Centos 6 machine. Other software doesn't have a problem listening on ports in this configuration. It's only GlassFish that had a problem. However, I have reconfigured /etc/hosts to workaround the GlassFish issue and posted the solution.
  • David Schwartz
    David Schwartz about 12 years
    Does 127.0.0.1 work on the machine? Can you ping it?
  • nickgrim
    nickgrim about 12 years
    Also, it's obviously worth stressing that changing your hosts file like that might have obscure knock-on effects with other things on that box that expect "localhost" to resolve to the loopback interface.
  • Steve
    Steve about 12 years
    @nickgrim GlassFish was binding to 0.0.0.0 which I tried changing to values such as 127.0.0.1, localhost, the public IP address and the private one, all to no avail. But you're probably right about localhost resolving to both an IPv4 and IPv6 address confusing it. I will look into it. Point taken regarding knock-on effects. Hopefully it doesn't have any security implications.
  • Steve
    Steve about 12 years
    @DavidSchwartz 127.0.0.1 did work on the machine. That's what it was initially configured with and if it didn't work I couldn't ssh into it.
  • Steve
    Steve about 12 years
    You work at joyent?
  • HopelessN00b
    HopelessN00b over 11 years
    This is one possibility, but the more complete answer is that any bind failure generates this message, as pointed out in the question comments.
  • bebbo
    bebbo over 11 years
    As the questioner pointed out: 'every port is taken'.
  • bebbo
    bebbo over 11 years
    So it's very unlikely that all ports are bound. Plus if the port is taken, there is a log entry in the server.log which shows you what's wrong and it would be easy to resolve. If the host name does not resolve, the server.log contains only the JVM parameters.
  • bhelm
    bhelm almost 6 years
    i have had an /etc/hosts entry with my hostname but an old/outdated ip. Changing it to the current one resolved this misleading error message.