public void main(Class<?> cls, String[] args) { Logger logger = null; try { logger = mainCanThrowExceptions(cls, args); } catch (Throwable e) { ExceptionUtil.outputException(e, System.out); if (logger!=null) { ExceptionUtil.logException(e, logger); } } }
public void run() { logger.error("Exception!",ex); try { String exceptionMessages = ExceptionUtil.getMessages(ex); JOptionPane.showMessageDialog(parentComponent, "Exception! See log (usually also printed to console)\n"+exceptionMessages,"An error occurred",JOptionPane.ERROR_MESSAGE); } catch(Exception xx){} } };
public void measureElementSimilarity(ElementFeatureScoreStorage elementFeatureScores, PersistenceDevice outR2LDevice, PersistenceDevice outL2RDevice, int startElementId) throws ElementSimilarityException, CreationException, ConfigurationException { //leftElemntSimilarities = new TIntObjectHashMap<TIntDoubleMap>(); ImmutableIterator<ElementFeatureScores> iterator = elementFeatureScores.getElementsFeatureScores(); ExecutorService executor = Executors.newFixedThreadPool(iThreadNum); // start the collector tasks for (int i=0;i<iThreadNum; i++) executor.execute(new ElementSimilarityTask(i+1,iterator,elementFeatureScores,outR2LDevice,outL2RDevice,startElementId)); // wait for terminations of all collectors try { executor.shutdown(); while (!executor.awaitTermination(1, TimeUnit.HOURS)) { logger.info("Still waiting for collector threads termination"); } } catch (InterruptedException e) { //logger.error(e.toString()); ExceptionUtil.getStackTrace(e); } logger.info("All similarity calculation threads were terminated"); }
/** * @param args (1) pos-tagger file-name, (2) easy-first host, (3) easy-first port * (4) nomlex-plus file, (5) class-role-table file */ public static void main(String[] args) { try { if (args.length<5) throw new RuntimeException("args"); DemoParseAndDisplay app = new DemoParseAndDisplay(args[0], args[1],Integer.parseInt(args[2]),args[3],args[4]); app.go(); } catch(Exception e) { ExceptionUtil.outputException(e, System.out); } }
ExceptionUtil.logException(e, logger); System.out.println(); System.out.println("Presenting GUI failed. Aborting.");
/** * @param args */ public static void main(String[] args) { try { System.out.println("Change log for: "+Version.getVersion().toString()); System.out.println(ChangeLog.logAsString()); } catch(Exception e) { ExceptionUtil.outputException(e, System.out); } }
ExceptionUtil.logException(exception, logger);
public static void main(String[] args) { try { if (args.length<1) { System.out.println("Argument missing. Should be configuration file name"); } String configurationFileName = args[0]; new LogInitializer(configurationFileName).init(); RTESumPreProcessor application = new RTESumPreProcessor(configurationFileName); application.preprocess(); } catch(Exception e) { ExceptionUtil.outputException(e, System.out); ExceptionUtil.logException(e, logger); } }
ExceptionUtil.outputException(e, System.out);
/** * @param args * 1st argument = output directory. * 2nd argument = C&C executable (path) * 3rd argument = C&C models directory * @return */ public static void main(String[] args) { try { if (args.length<3) throw new Exception("args. 1st argument should be a directory to put output images. 2nd - program. 3rd - models"); CandCDemoGui gui = new CandCDemoGui(args[0],args[1],args[2]); gui.init(); } catch(Exception e) { System.out.println("================================="); System.out.println("An exception occured!"); System.out.println(ExceptionUtil.getMessages(e)); System.out.println("========== stack trace =========="); e.printStackTrace(); } }
logger.error(ExceptionUtil.getStackTrace(e));
public static void main(String[] args) { // The only important line in this function is // runBiuteeCustomFlow(args[0], args[1]); try { try { if (args.length != 2) { throw new BiuteeMainException("Exactly 2 arguments must be provided: <configuration path> <flow list>"); } runBiuteeCustomFlow(args[0], args[1]); } finally { if (logger!=null) { GlobalMessages.getInstance().addToLogAndExperimentManager(logger); } } } catch(Throwable t) { ExceptionUtil.outputException(t, System.out); if (logger!=null) { try{ExceptionUtil.logException(t, logger);}catch(Throwable tt){} } } }
ExceptionUtil.outputException(e, System.out);
/** * @param args */ public static void main(String[] args) { try { if (args.length<3) throw new Exception("args. 1st argument should be a directory to put output images. 2nd - program. 3rd - models"); CandCDemo demo = new CandCDemo(new File(args[0]),args[1],args[2]); demo.start(); demo.readAndParse(); } catch(Exception e) { System.out.println("================================="); System.out.println("An exception occured!"); System.out.println(ExceptionUtil.getMessages(e)); System.out.println("========== stack trace =========="); e.printStackTrace(); } }
combinedStorage.write(entailingElementId, SortUtil.sortMapByValue(combinedEntailedsScores, true)); } catch (Exception e) { logger.error(ExceptionUtil.getStackTrace(e));
ExceptionUtil.outputException(e, System.out); try{ExceptionUtil.logException(e, logger);}catch(Exception ex){}
System.out.println(ExceptionUtil.getMessages(ex)); System.out.println("========== stack trace =========="); ex.printStackTrace();
combinedStorage.write(entailingElementId, SortUtil.sortMapByValue(combinedEntailedsScores, true)); } catch (Exception e) { logger.error(ExceptionUtil.getStackTrace(e));
combinedStorage.write(entailingElementId, SortUtil.sortMapByValue(combinedEntailedsScores, true)); } catch (Exception e) { logger.error(ExceptionUtil.getStackTrace(e));
logger.error(ExceptionUtil.getStackTrace(e));