Skip to content
Snippets Groups Projects
Commit cb7f8f67 authored by amine.chbari.etu's avatar amine.chbari.etu
Browse files

renommer l'exception en LaunchErrorException, et ajouter l'implementation de...

renommer l'exception en LaunchErrorException, et ajouter l'implementation de cette exception dans le package exception/
parent d8524591
Branches
Tags
No related merge requests found
...@@ -9,6 +9,7 @@ package org.red5.server; ...@@ -9,6 +9,7 @@ package org.red5.server;
import org.red5.logging.Red5LoggerFactory; import org.red5.logging.Red5LoggerFactory;
import org.red5.server.api.Red5; import org.red5.server.api.Red5;
import org.red5.server.exception.LaunchErrorException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.bridge.SLF4JBridgeHandler; import org.slf4j.bridge.SLF4JBridgeHandler;
import org.springframework.context.support.FileSystemXmlApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext;
...@@ -26,10 +27,10 @@ public class Launcher { ...@@ -26,10 +27,10 @@ public class Launcher {
/** /**
* Launch Red5 under it's own classloader * Launch Red5 under it's own classloader
* *
* @throws Exception * @throws LaunchErrorException
* on error * on error
*/ */
public void launch() throws Exception { public void launch() throws LaunchErrorException {
System.out.printf("Root: %s%nDeploy type: %s%n", System.getProperty(l_root), System.getProperty("red5.deployment.type")); System.out.printf("Root: %s%nDeploy type: %s%n", System.getProperty(l_root), System.getProperty("red5.deployment.type"));
// check for the logback disable flag // check for the logback disable flag
boolean useLogback = Boolean.valueOf(System.getProperty("useLogback", "true")); boolean useLogback = Boolean.valueOf(System.getProperty("useLogback", "true"));
...@@ -52,8 +53,12 @@ public class Launcher { ...@@ -52,8 +53,12 @@ public class Launcher {
// create red5 app context // create red5 app context
@SuppressWarnings("resource") @SuppressWarnings("resource")
FileSystemXmlApplicationContext root = new FileSystemXmlApplicationContext(new String[] { "classpath:/red5.xml" }, false); FileSystemXmlApplicationContext root = new FileSystemXmlApplicationContext(new String[] { "classpath:/red5.xml" }, false);
// set the current threads classloader as the loader for the factory/appctx try {
root.setClassLoader(Thread.currentThread().getContextClassLoader()); // set the current threads classloader as the loader for the factory/appctx
root.setClassLoader(Thread.currentThread().getContextClassLoader());
} catch (Exception e) {
throw new LaunchErrorException("possible mismatch between the classloader used to launch the application and the one expected by the context ", e);
}
root.setId(l_root); root.setId(l_root);
root.setBeanName(l_root); root.setBeanName(l_root);
// refresh must be called before accessing the bean factory // refresh must be called before accessing the bean factory
......
/*
* RED5 Open Source Media Server - https://github.com/Red5/ Copyright 2006-2023 by respective authors (see below). All rights reserved. Licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
* required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
package org.red5.server.exception;
/**
* Couldn't launch the server
*
*/
public class LaunchErrorException extends Exception{
/**
* this is serial Version is required from the owner developer that owns the right to initialize it
*/
// private static final long serialVersionUID = /* TODO */;
public LaunchErrorException(String message, Throwable cause) {
super(message, cause);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment