boolean () { ServerSettings settings; RPCServer rpc; XmlRpcClient client; IniFileParser parser; String status; try { parser = new IniFileParser(); parser.parseServerSettings(arguments[0],true); client = initRpcClient(); // Check if server is already running try { status = (String) client.execute("RPCAdministration.status",new Vector()); System.err.println("Server already started. Aborting"); System.exit(1); } catch(XmlRpcException e) { logger.info("No server running. Starting new instance..."); } settings = ServerSettings.getInstance(); logger.info("New rpc server"); rpc = RPCServer.getInstance(settings.getHost(),settings.getPort()); logger.info("Server start"); rpc.start(); client = initRpcClient(); client.execute("RPCAdministration.start",new Vector()); // Check if webserver is alive // otherwise stop execution while(true) { Thread.sleep(3000); if(!rpc.isAlive()) { rpc.shutdown(); break; } } logger.info("WebServer shutdown. Aborting..."); return true; } catch (ConfigurationException e) { //logger.error(e); System.exit(1); return false; } catch (InterruptedException e) { logger.error("VM did not allow to sleep. Aborting!"); } catch (XmlRpcException e) { System.out.println("Error starting server: " + e); System.exit(1); } catch (IOException e) { logger.error("IOException " + e.getMessage()); } catch (Exception e) { logger.error("IOException " + e.getMessage()); } catch(Throwable e) { logger.error("IOException " + e.getMessage()); } return false; }