Example usage for java.util.logging Level WARNING

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

Introduction

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

Prototype

Level WARNING

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

Click Source Link

Document

WARNING is a message level indicating a potential problem.

Usage

From source file:tools.datasync.db2db.util.Md5HashGenerator.java

public Md5HashGenerator() {
    try {//from  w w w . ja v a 2s. co  m
        messageDigest = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
        exceptionHandler.handle(e, Level.WARNING, "Error while initializing Hash Generator.");
    }
}

From source file:net.erdfelt.android.sdkfido.sdks.SourceOriginsLoader.java

public static SourceOrigins load(URL url) throws IOException {
    try {//from w ww .j av a2  s .com
        ConvertUtils.register(new VersionConverter(), Version.class);
        DigesterLoader loader = DigesterLoaderBuilder.byDefaultFactories();
        Digester digester = loader.createDigester(SourceOrigins.class);
        SourceOrigins origins = (SourceOrigins) digester.parse(url);
        origins.normalize();
        return origins;
    } catch (SAXException e) {
        LOG.log(Level.WARNING, "Unable to load/parse url: " + url, e);
        throw new IOException("Unable to load/parse url: " + url, e);
    }
}

From source file:it_minds.dk.eindberetningmobil_android.server.SafeJsonHelper.java

@Override
public JSONObject put(String name, long value) {
    try {/*from  w  ww. j  a  v  a  2s  . c  o  m*/
        return super.put(name, value);
    } catch (JSONException e) {
        Logger.getLogger("SafeJsonObject").log(Level.WARNING, "", e);
        return null;
    }
}

From source file:com.izforge.izpack.compiler.util.compress.ArchiveStreamFactory.java

public ArchiveInputStream createArchiveInputStream(File file, InputStream in) throws ArchiveException {
    try {/*from   w  w w.ja v a 2  s.  com*/
        final String mimeType = new Tika().detect(file);
        if ("application/x-7z-compressed".equals(mimeType)) {
            return new SevenZArchiveInputStream(file);
        }
    } catch (final IOException e) {
        logger.log(Level.WARNING,
                "Could not detect mime type of or open archive " + file + ": " + e.getMessage(), e);
    }

    return super.createArchiveInputStream(in);
}

From source file:com.willwinder.universalgcodesender.i18n.Localization.java

/**
 * Loads a given language. If no translations is found for the given language it will default to english.
 *
 * @param language the language to load, ex: en, sv, de
 * @param region the region of the language to load, ex: US, SE, DE
 * @return Returns false if some keys are missing compared to "en_US"
 *//*from  w  ww . java  2  s . c o m*/
synchronized public static boolean initialize(String language, String region) {
    try {
        loadResourceBundle(language, region);
    } catch (MissingResourceException e) {
        logger.log(Level.WARNING,
                "Couldn't find translations for the locale " + language + "_" + region + ". Reverts to en_US");
        loadResourceBundle("en", "US");
    }
    return getKeyCount(bundle) >= getEnglishKeyCount();
}

From source file:com.almende.util.ApacheHttpClient.java

/**
 * Instantiates a new apache http client.
 * //  w ww  . ja  v  a2s.c  o  m
 */
private ApacheHttpClient() {

    // generate httpclient
    httpClient = new DefaultHttpClient();

    // Set cookie policy and persistent cookieStore
    try {
        httpClient.setCookieStore(new MyCookieStore());
    } catch (final Exception e) {
        LOG.log(Level.WARNING, "Failed to initialize persistent cookieStore!", e);
    }
    final HttpParams params = httpClient.getParams();

    params.setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
    params.setParameter(CoreConnectionPNames.SO_TIMEOUT, 60000);
    params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 10000);
    params.setParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false);
    httpClient.setParams(params);
}

From source file:com.dalendev.meteotndata.importdata.TaskEnqueuer.java

/**
 * Enqueue a new task for the given Station.
 * The station will be serialized and passed as parameter to the task
 * @param station the Station//from  w ww .j  ava  2 s  .  c o  m
 * @return Boolean
 */
public static Boolean equeueUpdateStation(Station station) {
    Queue queue = QueueFactory.getDefaultQueue();
    try {
        byte[] serializedStation = SerializationUtils.serialize(station);
        queue.add(TaskOptions.Builder.withUrl("/tasks/updateStationData").payload(serializedStation));
        return true;
    } catch (SerializationException e) {
        Logger.getLogger(Importer.class.getName()).log(Level.WARNING, "Cannot Serialize a Station object", e);
        return false;
    }
}

From source file:com.amazonaws.services.kinesis.application.stocktrades.processor.StockTradesProcessor.java

/**
 * Sets the global log level to WARNING and the log level for this package to INFO,
 * so that we only see INFO messages for this processor. This is just for the purpose
 * of this tutorial, and should not be considered as best practice.
 *
 *//* www . ja v a 2 s  .c om*/
private static void setLogLevels() {
    ROOT_LOGGER.setLevel(Level.WARNING);
    PROCESSOR_LOGGER.setLevel(Level.INFO);
}

From source file:com.google.nigori.server.DatabaseNigoriProtocol.java

private static void warning(String message, Exception exception) {
    log.log(Level.WARNING, message, exception);
}

From source file:net.bluemix.connectors.local.IBMObjectStorageLocalConfigServiceInfoCreator.java

@Override
public IBMObjectStorageServiceInfo createServiceInfo(String id, String uri) {
    try {/*from ww  w. j  a  va2s.  co m*/
        return new IBMObjectStorageServiceInfo(id, uri);
    } catch (URISyntaxException e) {
        LOG.logp(Level.WARNING, IBMObjectStorageLocalConfigServiceInfoCreator.class.getName(),
                "createServiceInfo", "Invalid URI: " + uri, e);
        return null;
    }
}