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";
|
||||
|
||||
SpringApplication.run(OpenViduServer.class, argsAux);
|
||||
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -429,23 +429,23 @@ public class OpenviduConfig {
|
|||
public Set<OpenViduRole> getRolesFromRecordingNotification() {
|
||||
Set<OpenViduRole> roles = new HashSet<>();
|
||||
switch (this.openviduRecordingNotification) {
|
||||
case none:
|
||||
break;
|
||||
case moderator:
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
break;
|
||||
case publisher_moderator:
|
||||
roles.add(OpenViduRole.PUBLISHER);
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
break;
|
||||
case all:
|
||||
roles.add(OpenViduRole.SUBSCRIBER);
|
||||
roles.add(OpenViduRole.PUBLISHER);
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
break;
|
||||
default:
|
||||
roles.add(OpenViduRole.PUBLISHER);
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
case none:
|
||||
break;
|
||||
case moderator:
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
break;
|
||||
case publisher_moderator:
|
||||
roles.add(OpenViduRole.PUBLISHER);
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
break;
|
||||
case all:
|
||||
roles.add(OpenViduRole.SUBSCRIBER);
|
||||
roles.add(OpenViduRole.PUBLISHER);
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
break;
|
||||
default:
|
||||
roles.add(OpenViduRole.PUBLISHER);
|
||||
roles.add(OpenViduRole.MODERATOR);
|
||||
}
|
||||
return roles;
|
||||
}
|
||||
|
|
@ -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