List of usage examples for org.apache.commons.lang.exception ExceptionUtils getFullStackTrace
public static String getFullStackTrace(Throwable throwable)
A way to get the entire nested stack-trace of an throwable.
The result of this method is highly dependent on the JDK version and whether the exceptions override printStackTrace or not.
From source file:com.joshlong.lazyblogger.Main.java
public static void main(String[] args) { try {/*from ww w.ja v a 2 s .co m*/ Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread thread, Throwable e) { LOGGER.info(ExceptionUtils.getFullStackTrace(e)); } }); new ClassPathXmlApplicationContext("integrations-context.xml").start(); LOGGER.info("Started context: "); } catch (Throwable e) { LOGGER.info(ExceptionUtils.getFullStackTrace(e)); } }
From source file:com.alibaba.otter.node.deployer.OtterLauncher.java
public static void main(String[] args) throws Throwable { // ?dragoon client // startDragoon(); // logger.info("INFO ## the dragoon is start now ......"); final OtterController controller = OtterContextLocator.getOtterController(); controller.start();/*from w ww. j a v a 2s .c o m*/ try { logger.info("INFO ## the otter server is running now ......"); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { logger.info("INFO ## stop the otter server"); controller.stop(); } catch (Throwable e) { logger.warn("WARN ##something goes wrong when stopping Otter Server:\n{}", ExceptionUtils.getFullStackTrace(e)); } finally { logger.info("INFO ## otter server is down."); } } }); } catch (Throwable e) { logger.error("ERROR ## Something goes wrong when starting up the Otter Server:\n{}", ExceptionUtils.getFullStackTrace(e)); System.exit(0); } }
From source file:com.alibaba.otter.manager.deployer.OtterManagerLauncher.java
public static void main(String[] args) throws Throwable { try {// ww w . j av a 2 s . c o m String conf = System.getProperty("otter.conf", "classpath:otter.properties"); Properties properties = new Properties(); if (conf.startsWith(CLASSPATH_URL_PREFIX)) { conf = StringUtils.substringAfter(conf, CLASSPATH_URL_PREFIX); properties.load(OtterManagerLauncher.class.getClassLoader().getResourceAsStream(conf)); } else { properties.load(new FileInputStream(conf)); } // ??system? mergeProps(properties); logger.info("## start the manager server."); final JettyEmbedServer server = new JettyEmbedServer( properties.getProperty("otter.jetty", "jetty.xml")); server.start(); logger.info("## the manager server is running now ......"); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { logger.info("## stop the manager server"); server.join(); } catch (Throwable e) { logger.warn("##something goes wrong when stopping manager Server:\n{}", ExceptionUtils.getFullStackTrace(e)); } finally { logger.info("## manager server is down."); } } }); } catch (Throwable e) { logger.error("## Something goes wrong when starting up the manager Server:\n{}", ExceptionUtils.getFullStackTrace(e)); System.exit(0); } }
From source file:com.bloomreach.bstore.highavailability.clients.SolrCloudCrossClusterBackup.java
public static void main(String[] args) throws Exception { String sourceZk = args[0];//from w ww .ja v a 2 s .c om String destinationZookeeper = args[1]; //Define Zk Cloning Config Action. OperationConfig config = constructZkCloneConfig(sourceZk, destinationZookeeper); //Execute the Zk Clone Action. SolrFaultTolerantAction zkConfigsAction = SolrActionFactory.fetchActionToPerform(config); zkConfigsAction.executeAction(); //Define SolrCloud Collection Cloning Action. OperationConfig cloneCollectionConfig = constructClusterCloneConfig(sourceZk, destinationZookeeper); logger.info("Using " + sourceZk + " as the source zookeeper"); logger.info("Using " + destinationZookeeper + " as the destination zookeeper"); try { logger.info("Streaming data from Source cluster to Destination Solr Cluster ..."); //Execute solrCloud Collection Cloning SolrFaultTolerantAction cloneAction = SolrActionFactory.fetchActionToPerform(cloneCollectionConfig); cloneAction.executeAction(); logger.info("Streaming Successful from " + sourceZk + " cluster to " + destinationZookeeper + " Solr Cluster"); } catch (Exception e) { logger.info("Failed to stream collection:" + ExceptionUtils.getFullStackTrace(e)); throw new ClusterCloneException(ExceptionUtils.getFullStackTrace(e)); } }
From source file:com.bloomreach.bstore.highavailability.clients.SolrCloudCrossClusterBackupWithNewCollectionNames.java
public static void main(String[] args) throws Exception { String sourceZk = args[0];/*from w w w . j av a 2s. c o m*/ String destinationZookeeper = args[1]; //Define Zk Cloning Config Action. OperationConfig config = constructZkCloneConfig(sourceZk, destinationZookeeper); //Execute the Zk Clone Action. SolrFaultTolerantAction zkConfigsAction = SolrActionFactory.fetchActionToPerform(config); zkConfigsAction.executeAction(); //Define SolrCloud Collection Cloning Action. OperationConfig cloneCollectionConfig = constructClusterCloneConfig(sourceZk, destinationZookeeper); logger.info("Using " + sourceZk + " as the source zookeeper"); logger.info("Using " + destinationZookeeper + " as the destination zookeeper"); try { logger.info("Streaming data from Source cluster to Destination Solr Cluster ..."); //Execute solrCloud Collection Cloning SolrFaultTolerantAction cloneAction = SolrActionFactory.fetchActionToPerform(cloneCollectionConfig); cloneAction.executeAction(); logger.info("Streaming Succesful from " + sourceZk + " cluster to " + destinationZookeeper + " Solr Cluster"); } catch (Exception e) { logger.info("Failed to stream collection:" + ExceptionUtils.getFullStackTrace(e)); throw new ClusterCloneException(ExceptionUtils.getFullStackTrace(e)); } }
From source file:com.jslsolucoes.tagria.lib.tag.x.StringUtil.java
public static String fullStackTrace(Exception exception) { return ExceptionUtils.getFullStackTrace(exception).replaceAll("\n", "<br/>"); }
From source file:com.github.dirkraft.jash.JasherDriver.java
public static ValidationGateway validate(AbstractBundler bundler) { List<String> errors = new ArrayList<>(); try {//from w w w. j a va 2 s . co m errors = bundler.validateAndInit(); } catch (Exception e) { errors.add(ExceptionUtils.getFullStackTrace(e)); } if (errors.size() > 0) { JashIO.errf("There were parameter validation errors.%n"); JashIO.errf(JasherFormatter.bulleted(errors, JashIO.columns())).errf("%n"); return new ValidationFailedGateway(); } else { return new ValidationPassedGateway(); } }
From source file:com.apress.prospringintegration.concurrency.DemonstrationRunnable.java
public void run() { try {/*ww w .j a v a2s . c o m*/ Thread.sleep(1000); } catch (InterruptedException e) { System.out.println(ExceptionUtils.getFullStackTrace(e)); } System.out.println(Thread.currentThread().getName()); System.out.printf("Hello at %s \n", new Date()); }
From source file:com.enitalk.controllers.paypal.Usd.java
public static Pair<AutoPilot, VTDNav> getNavigator(byte[] xml) { Pair<AutoPilot, VTDNav> pair = new Pair<>(); try {//from w w w . j a v a 2s .c o m VTDGen vg = new VTDGen(); vg.setDoc(xml); vg.parse(true); VTDNav vn = vg.getNav(); AutoPilot ap = new AutoPilot(vn); pair.setLeft(ap); pair.setRight(vn); } catch (Exception ex) { System.out.println(ExceptionUtils.getFullStackTrace(ex)); } return pair; }
From source file:com.infullmobile.jenkins.plugin.restrictedregister.util.Utils.java
public static void logError(Throwable t) { final String ret = t.getMessage() + "\n" + ExceptionUtils.getFullStackTrace(t); logError(ret);/* ww w. jav a 2 s. co m*/ }