* Exit Helma if something important such as binding to a server port fails, rather than just logging the error.

* Replace date in version string with __builddate__ replacement token.
* Increase version number to 1.5.0.
This commit is contained in:
hns 2006-04-28 21:39:22 +00:00
parent 1b26370377
commit 3902f06136

View file

@ -42,7 +42,7 @@ import helma.util.ResourceProperties;
*/ */
public class Server implements IPathElement, Runnable { public class Server implements IPathElement, Runnable {
// version string // version string
public static final String version = "1.5.x (CVS)"; public static final String version = "1.5.0 (__builddate__)";
// static server instance // static server instance
private static Server server; private static Server server;
@ -669,11 +669,8 @@ public class Server implements IPathElement, Runnable {
// add shutdown hook to close running apps and servers on exit // add shutdown hook to close running apps and servers on exit
shutdownhook = new HelmaShutdownHook(); shutdownhook = new HelmaShutdownHook();
Runtime.getRuntime().addShutdownHook(shutdownhook); Runtime.getRuntime().addShutdownHook(shutdownhook);
} catch (Exception gx) { } catch (Exception x) {
logger.error("Error initializing embedded database: " + gx); throw new RuntimeException("Error setting up Server", x);
gx.printStackTrace();
return;
} }
// set the security manager. // set the security manager.
@ -689,18 +686,15 @@ public class Server implements IPathElement, Runnable {
logger.info("Setting security manager to " + secManClass); logger.info("Setting security manager to " + secManClass);
} }
} catch (Exception x) { } catch (Exception x) {
logger.error("Error setting security manager: " + x); logger.error("Error setting security manager", x);
} }
// start applications
appManager.startAll();
// start embedded web server // start embedded web server
if (http != null) { if (http != null) {
try { try {
http.start(); http.start();
} catch (MultiException m) { } catch (MultiException m) {
logger.error("Error starting embedded web server: " + m); throw new RuntimeException("Error starting embedded web server", m);
} }
} }
@ -708,10 +702,13 @@ public class Server implements IPathElement, Runnable {
try { try {
ajp13.start(); ajp13.start();
} catch (Exception m) { } catch (Exception m) {
logger.error("Error starting AJP13 listener: " + m); throw new RuntimeException("Error starting AJP13 listener: " + m);
} }
} }
// start applications
appManager.startAll();
while (Thread.currentThread() == mainThread) { while (Thread.currentThread() == mainThread) {
try { try {
Thread.sleep(3000L); Thread.sleep(3000L);