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:com.archivas.clienttools.arcmover.cli.ArcProfileMgr.java

@SuppressWarnings({ "UseOfSystemOutOrSystemErr" })
public static void main(String args[]) {
    ArcProfileMgr arcProfileMgr = null;//from   w w  w  . j  av a2s  .c o  m

    ConfigurationHelper.validateLaunchOK();

    try {
        arcProfileMgr = new ArcProfileMgr(args);
        arcProfileMgr.parseArgs();
        if (arcProfileMgr.printHelp) {
            System.out.println(arcProfileMgr.helpScreen());
        } else {
            arcProfileMgr.execute(new PrintWriter(System.out), new PrintWriter(System.err));
        }
    } catch (ParseException e) {
        System.out.println("Error: " + e.getMessage());
        System.out.println();
        System.out.println(arcProfileMgr.helpScreen());
        arcProfileMgr.setExitCode(EXIT_CODE_OPTION_PARSE_ERROR);
    } catch (Exception e) {
        LOG.log(Level.SEVERE, "Unexpected Exception.", e);
        System.out.println();
        System.out.println("Failed to create a new profile " + e.getMessage());
        arcProfileMgr.setExitCode(EXIT_CODE_DM_ERROR);
    } finally {
        if (arcProfileMgr != null) {
            arcProfileMgr.exit();
        }
    }
}

From source file:com.mafia.server.util.JacksonUtils.java

public static String objectToString(Object t) {
    try {//from   w ww  .ja  v a 2 s  .co  m
        ObjectMapper objectMapper = new ObjectMapper();
        return objectMapper.writeValueAsString(t);
    } catch (JsonProcessingException ex) {
        Logger.getLogger(JacksonUtils.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:com.vigglet.util.JsonUtil.java

public static void write(OutputStream os, Object model) {
    try {/*from ww w  .ja va 2 s .  c  o  m*/
        mapper.writeValue(os, model);
    } catch (Exception e) {
        logger.log(Level.SEVERE, e.getMessage(), e);
    }
}

From source file:deincraftlauncher.IO.download.FTPConnection.java

public static void changeDir(String dir) {
    try {//from   w ww. j a va 2 s .  c  o m
        client.changeWorkingDirectory(dir);
    } catch (IOException ex) {
        Logger.getLogger(FTPConnection.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:Main.java

public static String convertStringToMd5(String valor) {

    MessageDigest mDigest;/*from  ww w. ja v a  2s  .c om*/
    StringBuffer sb;

    if (valor == "") {
        return null;
    }
    try {
        mDigest = MessageDigest.getInstance("MD5");
        byte[] valorMD5 = mDigest.digest(valor.getBytes("UTF-8"));
        sb = new StringBuffer();

        for (byte b : valorMD5) {
            sb.append(Integer.toHexString((b & 0xFF) | 0x100).substring(1, 3));
        }
        return sb.toString();
    } catch (NoSuchAlgorithmException | UnsupportedEncodingException ex) {
        Logger.getLogger(MessageDigest.class.getName()).log(Level.SEVERE, null, ex);
        Logger.getLogger(StringBuffer.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }
}

From source file:com.espe.distribuidas.protocolocajero.pc.Originador.java

public static String getOriginador(String c) {
    String origen = "";
    try {/*from  w  w  w.j  av  a  2  s  .c  o  m*/
        InetAddress localHost = InetAddress.getLocalHost();
        origen = localHost.getHostAddress();
    } catch (UnknownHostException ex) {
        Logger.getLogger(Originador.class.getName()).log(Level.SEVERE, null, ex);
    }
    origen = origen + "@" + c;
    origen = StringUtils.rightPad(origen, 20, "0");
    return origen;
}

From source file:ejerciciospsp.practicando.frameFTP.java

/**
 * @param args the command line arguments
 *///from ww  w .j  a v  a 2 s.  c om
public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
     */
    try {
        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(frameFTP.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(frameFTP.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(frameFTP.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(frameFTP.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    }
    //</editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new frameFTP().setVisible(true);
        }
    });
}

From source file:de.quadrillenschule.azocamsynca.helpers.Formats.java

public static long toLong(String time) {
    SimpleDateFormat sdf = new SimpleDateFormat(DF);
    long retval = 0;
    try {//  w ww .j a va  2  s . c o m
        retval = sdf.parse(time).getTime() - sdf.parse("0:00:00").getTime();
    } catch (ParseException ex) {
        Logger.getLogger(Formats.class.getName()).log(Level.SEVERE, null, ex);
        return 0;
    }
    return retval;
}

From source file:chat.com.server.ChatServer.java

/**
 * @param args the command line arguments
 *///  ww  w.  ja v  a 2 s  .  com
public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
     */
    try {
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            if ("Metal".equals(info.getName())) {
                javax.swing.UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (ClassNotFoundException ex) {
        java.util.logging.Logger.getLogger(ChatServer.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(ChatServer.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(ChatServer.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(ChatServer.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    }
    //</editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new ChatServer().setVisible(true);
        }
    });
}

From source file:com.enseval.ttss.util.Util.java

public static Date toDate(String tgl) {
    Date ret = null;//from  w w  w.  j a  v a 2  s.  c o m
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

    try {
        ret = formatter.parse(tgl);
    } catch (ParseException ex) {
        Logger.getLogger(Util.class.getName()).log(Level.SEVERE, null, ex);
    }

    return ret;
}