mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: capture spring initialization error and better inform of port issues
parent
9bbe7787c7
commit
9b575bf778
|
|
@ -302,8 +302,21 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
argsAux[argsAux.length - 2] = "--spring.main.banner-mode=off";
|
||||
argsAux[argsAux.length - 1] = "--spring.main.allow-circular-references=true";
|
||||
|
||||
try {
|
||||
SpringApplication.run(OpenViduServer.class, argsAux);
|
||||
|
||||
} catch (org.springframework.context.ApplicationContextException e) {
|
||||
Throwable rootCause = e;
|
||||
while (rootCause.getCause() != null) {
|
||||
rootCause = rootCause.getCause();
|
||||
}
|
||||
if (rootCause instanceof java.net.BindException) {
|
||||
log.error("Cannot start OpenVidu Server on port {}: {}."
|
||||
+ " You can modify the port used by OpenVidu Server with the 'HTTPS_PORT' configuration property.",
|
||||
System.getProperty("server.port"), rootCause.getMessage());
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> Map<String, String> checkConfigProperties(Class<T> configClass) throws InterruptedException {
|
||||
|
|
|
|||
|
|
@ -677,7 +677,7 @@ public class OpenviduConfig {
|
|||
try {
|
||||
URI finalUri = new URI(this.getFinalUrl());
|
||||
this.coturnIp = finalUri.getHost();
|
||||
} catch (URISyntaxException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("Can't get Domain name from OpenVidu public Url: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue