I'm trying to run a spring boot application but the embedded Tomcat keeps on experiencing an error. I've tried changing the port to any unused port number.
Attaching most of the logs for your reference:
Caused by: java.net.BindException: Cannot assign requested address: connect
at java.base/sun.nio.ch.Net.connect0(Native Method) ~[na:na]
at java.base/sun.nio.ch.Net.connect(Net.java:454) ~[na:na]
at java.base/sun.nio.ch.Net.connect(Net.java:446) ~[na:na]
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648) ~[na:na]
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:194) ~[na:na]
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:127) ~[na:na]
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:76) ~[na:na]
... 35 common frames omitted
It probably is because another process is using the two ports you've tried.
Did you tried to list the ports that are being used?
On MacOS you can try running this in your terminal:
lsof -nP | grep LISTEN
If you are using Windows, you can run this in your powershell:
Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.