List of usage examples for java.lang Exception toString
public String toString()
From source file:com.econcept.pingconnectionutility.utility.PingConnectionUtility.java
public static void main(String[] args) { try {/*from ww w . j a va2 s . c om*/ //PingConnectionUtility.httpPingable("https://google.com"); // Working //PingConnectionUtility.httpPingable("https://api.soundcloud.com/oauth22"); // Fail PingConnectionUtility.httpPingable(args[0]); } catch (Exception exception) { System.out.println("Error in performing the request"); System.out.println(exception.toString()); } // catch }
From source file:com.microsoft.azure.servicebus.samples.topicfilters.TopicFilters.java
public static void main(String[] args) { System.exit(runApp(args, (connectionString) -> { TopicFilters app = new TopicFilters(); try {/* w w w. j a va 2s . c o m*/ app.run(connectionString); return 0; } catch (Exception e) { System.out.printf("%s", e.toString()); return 1; } })); }
From source file:bvt.TestRunner.java
public static void main(String[] args) { try {//from w ww. j av a 2s . c o m new TestRunner().run(args); } catch (Exception e) { System.out.println("[LexBIG] *** Launch failed: " + e.toString()); } }
From source file:com.hurence.logisland.runner.SparkJobLauncher.java
/** * main entry point/*w w w . j a v a 2 s .c o m*/ * * @param args */ public static void main(String[] args) { logger.info("starting StreamProcessingRunner"); ////////////////////////////////////////// // Commande lien management Parser parser = new GnuParser(); Options options = new Options(); String helpMsg = "Print this message."; Option help = new Option("help", helpMsg); options.addOption(help); OptionBuilder.withArgName(AGENT); OptionBuilder.withLongOpt("agent-quorum"); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription("logisland agent quorum like host1:8081,host2:8081"); Option agent = OptionBuilder.create(AGENT); options.addOption(agent); OptionBuilder.withArgName(JOB); OptionBuilder.withLongOpt("job-name"); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription("logisland agent quorum like host1:8081,host2:8081"); Option job = OptionBuilder.create(JOB); options.addOption(job); String logisland = " \n" + " ???????? ????? ?? ??\n" + " \n" + " ???? ?? \n" + "?? ?\n" + "??????? ?????? ?????? ?????????????????? ???? ?????????? v0.10.0-SNAPSHOT\n\n\n"; System.out.println(logisland); Optional<EngineContext> engineInstance = Optional.empty(); try { // parse the command line arguments CommandLine line = parser.parse(options, args); String agentQuorum = line.getOptionValue(AGENT); String jobName = line.getOptionValue(JOB); // instanciate engine and all the processor from the config engineInstance = new RestComponentFactory(agentQuorum).getEngineContext(jobName); assert engineInstance.isPresent(); assert engineInstance.get().isValid(); logger.info("starting Logisland session version {}", engineInstance.get()); } catch (Exception e) { logger.error("unable to launch runner : {}", e.toString()); } try { // start the engine EngineContext engineContext = engineInstance.get(); engineInstance.get().getEngine().start(engineContext); } catch (Exception e) { logger.error("something went bad while running the job : {}", e); System.exit(-1); } }
From source file:com.microsoft.azure.servicebus.samples.jmstopicquickstart.JmsTopicQuickstart.java
public static void main(String[] args) { System.exit(runApp(args, (connectionString) -> { JmsTopicQuickstart app = new JmsTopicQuickstart(); try {//from w w w. j a v a2 s . co m app.run(connectionString); return 0; } catch (Exception e) { System.out.printf("%s", e.toString()); return 1; } })); }
From source file:com.microsoft.azure.servicebus.samples.queuesgettingstarted.QueuesGettingStarted.java
public static void main(String[] args) { System.exit(runApp(args, (connectionString) -> { QueuesGettingStarted app = new QueuesGettingStarted(); try {//w w w . java 2 s . c o m app.run(connectionString); return 0; } catch (Exception e) { System.out.printf("%s", e.toString()); return 1; } })); }
From source file:com.microsoft.azure.servicebus.samples.partitionedqueues.PartitionedQueues.java
public static void main(String[] args) { System.exit(runApp(args, (connectionString) -> { PartitionedQueues app = new PartitionedQueues(); try {/* ww w . j ava2s.c o m*/ app.run(connectionString); return 0; } catch (Exception e) { System.out.printf("%s", e.toString()); return 1; } })); }
From source file:com.microsoft.azure.servicebus.samples.scheduledmessages.ScheduledMessages.java
public static void main(String[] args) { System.exit(runApp(args, (connectionString) -> { ScheduledMessages app = new ScheduledMessages(); try {//from w w w . java 2 s. co m app.run(connectionString); return 0; } catch (Exception e) { System.out.printf("%s", e.toString()); return 1; } })); }
From source file:com.idega.util.FileLocalizer.java
public static void main(String[] args) { if (args.length != 2) { System.err.println("Wimp. I need two parameters, input file og directory and output file"); System.err.println("Usage java FileLocalizer input output"); return;/*from ww w . j a v a 2s . c om*/ } File in = null; BufferedWriter out = null; Properties props = new Properties(); try { in = new File(args[0]); } catch (Exception e) { System.err.println("Auli. Error : " + e.toString()); return; } try { out = new BufferedWriter(new FileWriter(args[1])); } catch (java.io.IOException e) { System.err.println("Auli. Error : " + e.toString()); return; } try { findRecursive(in, props); props.list(new PrintWriter(out)); } catch (Exception e) { System.err.println("Error reading or writing file : " + e.toString()); } try { out.close(); } catch (java.io.IOException e) { System.err.println("Error closing files : " + e.toString()); } }
From source file:testSig.java
public static void main(String[] args) { /* Test generating and verifying a DSA signature */ try {/*from w w w.ja v a 2 s . co m*/ /* generate a key pair */ KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA"); keyGen.initialize(1024, new SecureRandom()); KeyPair pair = keyGen.generateKeyPair(); /* * create a Signature object to use for signing and verifying */ Signature dsa = Signature.getInstance("SHA/DSA"); /* initialize the Signature object for signing */ PrivateKey priv = pair.getPrivate(); dsa.initSign(priv); /* Update and sign the data */ FileInputStream fis = new FileInputStream(args[0]); byte b; while (fis.available() != 0) { b = (byte) fis.read(); dsa.update(b); } ; fis.close(); /* * Now that all the data to be signed has been read in, sign it */ byte[] sig = dsa.sign(); /* Verify the signature */ /* Initialize the Signature object for verification */ PublicKey pub = pair.getPublic(); dsa.initVerify(pub); /* Update and verify the data */ fis = new FileInputStream(args[0]); while (fis.available() != 0) { b = (byte) fis.read(); dsa.update(b); } ; fis.close(); boolean verifies = dsa.verify(sig); System.out.println("signature verifies: " + verifies); } catch (Exception e) { System.err.println("Caught exception " + e.toString()); } }