Tomcat - Address already in use but no process - windows

I was having an issue with Tomcat 10.1 where I was always getting "Address already in use", but checking netstat -ano | findstr ":<port>" showed no bound processes.

What I found out was that if you are running Win 10 + Hyper-V + Docker for Windows; Windows will reserve a whole lot of ports. So you have to use a port outside those ranges or you can netsh to exclude a port range.

Related

Unable to find the processes that uses a certain port on Windows 10

unforuneatelly I am not able to start any process on port 2022 on my computer. I'm using Windows 10 Enterprise 1803. I tried to start an IIS site on that port and got an "HRESULT: 0x80070020" error. The same happens when I start an angular "ng serve" on that port.
I tried to find out what process is using that port via netstat -ano | find ":2022" but that gave no output at all (works for other ports). The Windows Resource Manager does not show that port eigther.
Sometimes if I'm lucky after re-adding the site to IIS and reboot the IIS can start on that port.
You should not simply filter on port number, like 2022: "netstat" sometimes returns ranges or wildcards, check the entire "netstat" result if any range or wildcard might cover your 2022 port.

How can I identify which process is using port 18780 on Windows?

I have an internal web application listening on all IPs on port 18780. When I try to start the application on a new Windows VM it throws this exception:
System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:18780
After rebooting the machine the application starts just fine, but I'd like to avoid having to reboot all of my new QA environments before I can use them.
IANA reports that nothing well-known uses port 18780.
The last time this happened I tried to identify what process was running on that port:
Running Get-Process -Id (Get-NetTCPConnection -LocalPort 18780).OwningProcess returned Cannot find a process with the process identifier 7188. Powershell is running under a local admin account.
So what's happening here? It looks like there's something using that port, it's got a process Id, but I'm unable to get the details of it. Running this powershell command a second time reports that there's nothing listening that port. Does the act of observation change Windows processes?
What further steps can I take to find out more about Schrödinger's process?
Caught this happening again.
Turns out that my application had spawned three child processes, and those were still running. Windows apparently doesn't release a TCP port until the owning process record is cleaned up, and child processes maintain this record. Even though the parent process was stopped, and showed in TCPViewer as <non-existent>, the port was still unavailable.
This is also described here: https://serverfault.com/questions/181015/how-do-you-free-up-a-port-being-held-open-by-dead-process
I used wmic process where (ParentProcessId=7188) get Caption,ProcessId to identify which child processes to kill, and that did the trick. Windows released the port straight away.
try following in powershell:
netstat -ano | findstr :<port>
this will give you the details about the process id
then use following to kill the process:
taskkill /PID <processid> /F

Tomcat Debug Error: Unable to open debugger port (127.0.0.1:63199): java.net.BindException "Address already in use: NET_Bind"

I woke up for work and started receiving this error, but I can't find this specific error anywhere.
I tried using netstat -ano to find any instances running on the aformentioned port, and also the ports I run Tomcat on:
HTTP port: 8090
JMX port: 1099
But no processes are running on any of the three ports. Any ideas?
Oh,my! This helps me a lot
// first,close your idea
// then, run cmd as administator
net stop winnat
net start winnat
// launch your idea
Before,I have tried this,but it doesn't work
ipconfig /flushdns
netsh winsock reset
As for me,the problem begin when i use idea to debug my web application.
Then i find where the port configured and change to another port.
this link might be helpful
net stop winnat
launch your idea tomcat
net start winnat

Windows 10 Kill EDB Postgres 8080 server

I want to kill and remove the software that uses the 8080 port that EDB Postgres localhost server so I can use the port for Jenkins.
Using tasklist it tells me the port which is processing, fine for kill the process, but where can I delete uninstall the software.
Just find the server named "PEM HTTPD" and turn it off.Also you can change its start mode to manual.
tasklist is good but you can also use netstat -ano to find the port if you didn't find the process but in taskmanager in windows 10 there is a services tab with a PID column. Just click the column and find the PID. Then right click it and hit properties to find the path of the software. Kill the process and remove the software. Restart and see if it works.

Port 8005 is used By Windows 10 System Process

Since today, the port 8005 is used for a Windows System Process. When i try to acces to the url http:localhost:8005 ,i can see a Blank Web Page, with no code and no info from any Web Server (No welcome web page or similar).
With the netstat command i can see that the process that uses this port is System process. Any idea why windows is using suddenly this port?
EDIT: Not duplicate question. I don't have another Tomcat installation, the problem comes from a windows process, not for another tomcat instance.
Check if port 8005 is really in use by Windows :
Install and run Sysinternals TCPView and
Check if the line with "Local Port" 8005 has as "Process" System
Or check the file c:\Windows\CCM\Logs\DeltaDownload.log for port 8005
If the port is in use by system, go to Computer Management and stop the service "SMS Agent Host" or open a command prompt as administrator and type:
sc stop CcmExec
The problems comes from a Windows Service:
https://www.niallbrady.com/2017/02/15/how-can-i-use-express-updates-when-patching-windows-10-with-quality-updates-in-system-center-configuration-manager-current-branch/
Not from another Tomcat instance.
I too was facing the same with windows 10 and ran the command netstat -a -b which showed CmRcService.exe is using the port 8005 on the machine.
The most weird part is sometimes if i hit localhost:8005 in the browser url its asking for username and password to access the page and in the developers tools I cannot see any application name or data whatsoever

Resources