List of usage examples for java.util.logging Level SEVERE
Level SEVERE
To view the source code for java.util.logging Level SEVERE.
Click Source Link
From source file:eu.europeana.datamigration.ese2edm.LogCleaner.java
public static void main(String[] args) { try {/*from w ww .j a v a2 s. c o m*/ List<String> lines = FileUtils.readLines(new File("/home/gmamakis/test.log")); List<String> newLines = new ArrayList<String>(); for (String line : lines) { if (!line.startsWith("Apr")) { newLines.add(line); } } FileUtils.writeLines(new File("/home/gmamakis/rdfslabel.log"), newLines); } catch (IOException ex) { Logger.getLogger(LogCleaner.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:di.uniba.it.tee2.wiki.TestWikiIterator.java
/** * @param args the command line arguments *//* w w w . j av a 2 s . co m*/ public static void main(String[] args) { try { WikipediaDumpIterator it = new WikipediaDumpIterator(new File(args[0]), "UTF-8"); while (it.hasNext()) { WikiPage page = it.next(); System.out.println(page.getWikiID()); System.out.println(page.getRevisionID()); System.out.println(page.getTitle()); System.out.println(); } } catch (XMLStreamException | CompressorException | IOException ex) { Logger.getLogger(TestWikiIterator.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:edu.eci.cosw.samples.logic.Main.java
public static void main(String[] args) { ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml"); ServiceFacade sf = ac.getBean(ServiceFacade.class); List<Cliente> clientes = null; try {/* w w w. j a v a2s. co m*/ clientes = sf.clientesReportadosPorApellido("var"); } catch (ClientEvaluationException ex) { System.out.println("Fallo consulta por apellido"); Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } if (clientes != null) { for (Cliente c : clientes) { System.out.println( c.getIdcliente() + " " + c.getNombre() + " " + c.getDireccion() + " " + c.getTelefono()); } } try { //Registrar un nuevo cliente sf.registrarCliente(1072672, "Guillermo Alvarez", "Calle 3#3E-116", "1234567"); } catch (ClientEvaluationException ex) { System.out.println("Fallo insercion"); Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } //Crear un pedido Date d = new Date(2015 - 1900, 8, 23); int[] idProductos = { 1 }; int[] cantidades = { 3 }; sf.registrarPedido(1072672, idProductos, cantidades, d); //Mirar en la base de datos que se creo el pedido de este cliente try { //Consulta Fallida sf.registrarCliente(333, "Luis Alvarez", "Calle 3E#3-116", "1234567"); } catch (ClientEvaluationException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:nayan.netty.client.FileUploadClient.java
public static void main(String args[]) { for (int i = 0; i < CLIENT_COUNT; i++) { new Thread(new Runnable() { @Override// www . ja va 2 s.c o m public void run() { try { uploadFile(); } catch (Exception ex) { Logger.getLogger(FileUploadClient.class.getName()).log(Level.SEVERE, null, ex); } } }).start(); } }
From source file:apps.provisioning.Main.java
public static void main(String[] args) throws Exception { Commands commands;//from w w w . j a va2s . c om try { commands = new Commands(args); } catch (ParseException e) { logger.log(Level.SEVERE, "Unable to process commands. Terminating application.", e); return; } ProvisioningApp app = ProvisioningApp.getInstance(); try { app.initApp(commands, CONFIG_FILE_PATH); } catch (ParseException e) { logger.log(Level.SEVERE, "Unable to initialize application. Terminating application.", e); return; } }
From source file:net.freedom.gj.example.Main.java
public static void main(String[] args) { try {/*from w w w . j av a2 s.com*/ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) { Logger.getLogger(EmployeeView.class.getName()).log(Level.SEVERE, null, ex); } System.out.println("Welcome to EL entity mapper demonstration.\n"); AbstractApplicationContext ctx = new ClassPathXmlApplicationContext( new String[] { "net/freedom/gj/example/mapping/mapping-configuration.xml" }); ctx.registerShutdownHook(); }
From source file:com.mycompany.webtestegit.util.TesteMail.java
public static void main(String[] args) { SimpleEmail email = new SimpleEmail(); email.setHostName("smtp.gmail.com"); // o servidor SMTP para envio do e-mail try {// ww w.jav a2 s .com email.addTo("cfs.bsi@gmail.com", "Christian"); //destinatrio email.setFrom("programacao.micromap@gmail.com", "Micromap"); // remetente email.setSubject("Titulo do e-mail"); // assunto do e-mail email.setMsg("Teste de Email utilizando commons-email"); //conteudo do e-mail email.setAuthentication("ORIGEM", "SENHA"); email.setSSLCheckServerIdentity(true); email.send(); //envia o e-mail } catch (EmailException ex) { Logger.getLogger(TesteMail.class.getName()).log(Level.SEVERE, null, ex); } //EMAIL HTML // HtmlEmail email = new HtmlEmail(); // // try { // email.setHostName("smtp.gmail.com"); // email.addTo("cfs.bsi@gmail.com", "Cfs"); // email.setFrom("programacao.micromap@gmail.com", "Micromap"); // email.setSubject("Teste de e-mail em formato HTML"); // // // // adiciona uma imagem ao corpo da mensagem e retorna seu id // URL url = new URL("http://www.apache.org/images/asf_logo_wide.gif"); // String cid = email.embed(url, "Apache logo"); // // // configura a mensagem para o formato HTML // email.setHtmlMsg("<html>The apache logo - <img src=\"cid:" + cid + "\"></html>"); // // // configure uma mensagem alternativa caso o servidor no suporte HTML // email.setTextMsg("Seu servidor de e-mail no suporta mensagem HTML"); // email.setAuthentication("ORIGEM", "SENHA"); // // // envia o e-mail // email.send(); // } catch (EmailException ex) { // Logger.getLogger(TesteMail.class.getName()).log(Level.SEVERE, null, ex); // } catch (MalformedURLException ex) { // Logger.getLogger(TesteMail.class.getName()).log(Level.SEVERE, null, ex); // } }
From source file:org.dineth.shooter.client.Example.java
public static void main(String[] args) { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://localhost:8080/upload"); filename = "router.jpg"; FileBody bin = new FileBody(new File(filename)); StringBody fileName = null;/*from ww w . j av a 2 s .c o m*/ try { fileName = new StringBody(filename); } catch (UnsupportedEncodingException ex) { Logger.getLogger(Example.class.getName()).log(Level.SEVERE, null, ex); } MultipartEntity reqEntity = new MultipartEntity(); reqEntity.addPart("file", bin); reqEntity.addPart("filename", fileName); httppost.setEntity(reqEntity); HttpResponse response = null; try { response = httpclient.execute(httppost); } catch (IOException ex) { Logger.getLogger(Example.class.getName()).log(Level.SEVERE, null, ex); } HttpEntity resEntity = response.getEntity(); }
From source file:com.dclab.preparation.ReadTest.java
public static void main(String[] args) { try {//from w ww . j ava 2s. co m ReadTest app; app = new ReadTest("/Users/richardthorne/Downloads/forward-flow"); } catch (IOException ex) { Logger.getLogger(ReadTest.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.linuxrouter.netcool.test.DbPoolTest.java
public static void main(String[] args) { String host = "192.168.0.201"; String port = "4100"; String dbName = "alerts"; String url = "jdbc:sybase:Tds:" + host + ":" + port + "/" + dbName; Driver drv = new com.sybase.jdbc3.jdbc.SybDriver(); try {/*from w ww . j a v a2 s .c o m*/ DriverManager.registerDriver(drv); } catch (SQLException ex) { Logger.getLogger(DbPoolTest.class.getName()).log(Level.SEVERE, null, ex); } ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, "root", "omni12@#"); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, null); ObjectPool<PoolableConnection> connectionPool = new GenericObjectPool<>(poolableConnectionFactory); poolableConnectionFactory.setPool(connectionPool); PoolingDataSource<PoolableConnection> poolingDataSource = new PoolingDataSource<>(connectionPool); try { Connection con = poolingDataSource.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from alerts.status"); int x = 0; while (rs.next()) { //System.out.println(":::" + rs.getString(1)); x++; } System.out.println("::::::" + x); } catch (SQLException ex) { Logger.getLogger(DbPoolTest.class.getName()).log(Level.SEVERE, null, ex); } }