Class PortInUseException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.boot.web.server.WebServerException
- org.springframework.boot.web.server.PortInUseException
- All Implemented Interfaces:
Serializable
public class PortInUseException extends WebServerException
APortInUseException
is thrown when a web server fails to start due to a port already being in use.- Since:
- 2.0.0
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor Description PortInUseException(int port)
Creates a new port in use exception for the givenport
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPort()
Returns the port that was in use.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
PortInUseException
public PortInUseException(int port)
Creates a new port in use exception for the givenport
.- Parameters:
port
- the port that was in use
Method Detail
getPort
public int getPort()
Returns the port that was in use.- Returns:
- the port