Reputation: 53
I am reproducing this on windows 10, java 11 and java 8, but the following scenario is happening:
The port is actually never open, by looking at netstat -qno, or netstat -ano with administrator rights, the entry never actually shows up, so no process is actually using it.
If I try restarting tomcat with a different port, the same problem repeats but now we have a different unusable port. If I restart my computer the port is free again, but as soon as I try to start tomcat, the problem repeats.
It seems to me like intellij/tomcat is messing up server/port/bind on windows and produces an unusable port.
Upvotes: 1
Views: 416
Reputation: 402235
netsh interface ipv4 show excludedportrange protocol=tcp
would reveal the ports blocked/excluded, Hyper-V is known to incorrectly exclude huge port ranges and it's used with WSL2.
You could try changing the range of the dynamic ports with the following commands:
netsh int ipv4 set dynamicport tcp start=49152 num=16383
netsh int ipv4 set dynamicport udp start=49152 num=16383
Upvotes: 1