aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Port 4849 stuck/invisible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Port 4849 stuck/invisible?" Watch "Port 4849 stuck/invisible?" New topic
Author

Port 4849 stuck/invisible?

Manny Garcia
Greenhorn

Joined: Apr 04, 2007
Posts: 28
Howdy,

I'm attempting to start an instance of a glassfish server immediately after I've (gracefully) stopped it. When I try to restart it I get the following error:
There is a process already using the admin port 4849 -- it probably is another instance of a GlassFish server.

The problem is I do a netstat looking for the process that owns that port and I can't find anything! I have to find a pid to kill so I can restart the server. Does anyone have any ideas?

Regards,

Manny
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18999
    
  40

Manny Garcia wrote:
I'm attempting to start an instance of a glassfish server immediately after I've (gracefully) stopped it. When I try to restart it I get the following error:
There is a process already using the admin port 4849 -- it probably is another instance of a GlassFish server.

The problem is I do a netstat looking for the process that owns that port and I can't find anything! I have to find a pid to kill so I can restart the server. Does anyone have any ideas?


With TCP, sometime it takes a few minutes before the operating system frees up the port. To solve this, you have two options. You can put in a delay between the kill of the process to the restart of the process -- hopefully, it will be enough time for the OS to free the port. Another option is to open the port with the REUSEADDR option -- or configure glassflish to use that option.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Manny Garcia
Greenhorn

Joined: Apr 04, 2007
Posts: 28
I tried waiting it out, overnight and still the problem persisted. I tired about every permutation of a ps lookup I could and could find nothing referencing that port. Finally our IT guy gets back to me and says that they've been diddling with the hosts file on that machine and that requests to start glassfish might actually be going to another server where the same application is running, hence my inability to locate that port on this particular machine. He's going to mess with the hosts file and get back to me. If this works I intend to do violence to our IT guy.

I generally don't delve into this sort of thing, so I'm not sure if his explanation is bullsh*t or not. I'm a code monkey, so this has been a rather frustrating experience on the whole.

Regards,

Manny
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18909
    
    8

Manny Garcia wrote:I'm a code monkey, so this has been a rather frustrating experience on the whole.


No kidding. Don't you hate it when you have to become a network expert?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Port 4849 stuck/invisible?