Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Every so often when trying to start up my Java appserver on my WinXP box, it fails to start with an "Address already in use" error when trying to listen on a port. The usual solution for me is to fire up tcpview (from sysinternals), see what's using that port, killing that process, then trying again. Works 99% of the time.

The remaining 1%, however, this doesn't work. The appserver insists the port (e.g. port 1099, not that it matters) is in use, and tcpview insists equally strongly that it isn't.

The appserver is just delegating the server socket creation to windows, so I can't see it being a java-specific issue, although I'm happy to be corrected on that.

What gives? Is tcpview missing out some corner case? Is there a better tool that would help me diagnose these situations?

share|improve this question
1  
The error is real but the error message content may be bogus. It may have failed to open a port because it is on a non-local IP address, or some other error that may not even be port related. –  kmarsh Oct 12 '09 at 12:59
    
If it were because of a non-local IP address, it would be a reliably reproducable error, no? –  skaffman Oct 12 '09 at 20:53
add comment

2 Answers

additionally, you could try

netstat -ano

to find the ProcessID and to narrow it down a bit, assuming your port is 8191

netstat -ano | find "8191"
share|improve this answer
add comment

Weird. To pinpoint the problem, you could try

netstat -an

That should also list all ports in use. If it disagrees, the problem might be with tcpview. Otherwise, you'd have to look elsewhere.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.