List of usage examples for java.lang Exception printStackTrace
public void printStackTrace()
From source file:de.tudarmstadt.ukp.experiments.argumentation.convincingness.createdebate.CorpusPreparator.java
public static void main(String[] args) { try {/*from w ww . j a v a 2 s. com*/ // args[0] = directory with exported html pages File inFolder = new File(args[0]); // args[1] = output directory File outFolder = new File(args[1]); outFolder.mkdir(); // args[2] = parser implementation DebateParser parser = (DebateParser) Class.forName(args[2]).newInstance(); extractAllDebates(inFolder, outFolder, parser); } catch (Exception e) { e.printStackTrace(); } }
From source file:gov.va.vinci.leo.tools.GenerateDescriptors.java
/** * Main method for running from the command line. * @param args command line arguements.// w w w. j ava2s. c o m */ public static void main(String[] args) { if (args.length != 2) { System.out.println( "Usage: GenerateDescriptors <annotator class name> <root directory to write files to>"); System.exit(1); } String annotatorClassName = args[0]; String outputRootPath = args[1]; try { GenerateDescriptors.generate(annotatorClassName, outputRootPath); } catch (Exception e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. System.exit(2); } System.exit(0); }
From source file:indexing.WTDocIndexer.java
public static void main(String[] args) { if (args.length == 0) { args = new String[1]; System.out.println("Usage: java WTDocIndexer <prop-file>"); args[0] = "wt10g.properties"; }/*w ww. j av a 2s . c o m*/ try { WTDocIndexer indexer = new WTDocIndexer(args[0]); indexer.processAll(); } catch (Exception ex) { ex.printStackTrace(); } }
From source file:GetImportToListStatus.java
public static void main(String[] args) { System.out.println("Executing Get Import To List Status"); try {/* w w w. j ava 2 s .co m*/ URL marketoSoapEndPoint = new URL("CHANGE ME" + "?WSDL"); String marketoUserId = "CHANGE ME"; String marketoSecretKey = "CHANGE ME"; QName serviceName = new QName("http://www.marketo.com/mktows/", "MktMktowsApiService"); MktMktowsApiService service = new MktMktowsApiService(marketoSoapEndPoint, serviceName); MktowsPort port = service.getMktowsApiSoapPort(); // Create Signature DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); String text = df.format(new Date()); String requestTimestamp = text.substring(0, 22) + ":" + text.substring(22); String encryptString = requestTimestamp + marketoUserId; SecretKeySpec secretKey = new SecretKeySpec(marketoSecretKey.getBytes(), "HmacSHA1"); Mac mac = Mac.getInstance("HmacSHA1"); mac.init(secretKey); byte[] rawHmac = mac.doFinal(encryptString.getBytes()); char[] hexChars = Hex.encodeHex(rawHmac); String signature = new String(hexChars); // Set Authentication Header AuthenticationHeader header = new AuthenticationHeader(); header.setMktowsUserId(marketoUserId); header.setRequestTimestamp(requestTimestamp); header.setRequestSignature(signature); // Create Request ParamsGetImportToListStatus request = new ParamsGetImportToListStatus(); request.setProgramName("Trav-Demo-Program"); request.setListName("Trav-Test-List"); SuccessGetImportToListStatus result = port.getImportToListStatus(request, header); JAXBContext context = JAXBContext.newInstance(SuccessGetImportToListStatus.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.marshal(result, System.out); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.bytecode.util.SendEmail.java
public static void main(String args[]) { try {/*from www. j a v a 2 s. com*/ Email email = new Email(); email.setEmailAddress("lawale4me@yahoo.com"); email.setSubject("Your have create a new Case :"); email.setMessage("Case Body" + "\n"); System.out.println("about to send"); new SendEmail().sendSimpleMail(email); System.out.println("sent"); } catch (Exception ex) { ex.printStackTrace(); } }