public void die(String message) { die(message, null); }
private void die(String message) { die(message, null); }
private void configureLog4j() { File homeDir = new File(System.getProperty("opennms.home")); File etcDir = new File(homeDir, "etc"); File xmlFile = new File(etcDir, "log4j.xml"); if (xmlFile.exists()) { DOMConfigurator.configureAndWatch(xmlFile.getAbsolutePath()); } else { File propertiesFile = new File(etcDir, "log4j.properties"); if (propertiesFile.exists()) { PropertyConfigurator.configureAndWatch(propertiesFile.getAbsolutePath()); } else { die("Could not find a Log4j configuration file at " + xmlFile.getAbsolutePath() + " or " + propertiesFile.getAbsolutePath() + ". Exiting."); } } /* * This is causing infinite recursion on exit * CaptchaStds.captchaStdOut(); */ }
/** * <p>startDaemon</p> */ public void startDaemon() { try { setLogPrefix(); setDefaultProperties(); start(); } catch(Exception e) { die("Exception during startup: " + e.getMessage(), e); } }
props.load(in); } catch (IOException e) { die("Error trying to read properties file '" + propertiesFile + "': " + e, e); } finally { IOUtils.closeQuietly(in);