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:com.iontorrent.main.TSSettings.java

private void warn(String msg) {
    Logger.getLogger(TSSettings.class.getName()).log(Level.WARNING, msg);
}

From source file:com.almende.eve.state.mongo.MongoStateBuilder.java

/**
 * Gets the instance by params./*from   w ww  .  j a va  2s. co  m*/
 * 
 * @param params
 *            the params
 * @return the instance by params
 */
public MongoStateProvider getInstanceByParams(final ObjectNode params) {
    final MongoStateConfig config = MongoStateConfig.decorate(params);
    final String key = config.getKey();

    if (instances.containsKey(key)) {
        return instances.get(key);
    } else {
        synchronized (instances) {
            if (!instances.containsKey(key)) {
                try {

                    final MongoStateProvider result = new MongoStateProvider(params);
                    if (result != null) {
                        instances.put(key, result);
                    }
                } catch (final UnknownHostException e) {
                    LOG.log(Level.WARNING, "Couldn't init MongoStateService", e);
                }
            }
            return instances.get(key);
        }
    }
}

From source file:org.osiam.resources.exceptions.OsiamExceptionHandler.java

@ExceptionHandler(value = { Exception.class })
protected ResponseEntity<Object> handleConflict(Exception ex, WebRequest request) {
    LOGGER.log(Level.WARNING, "An exception occurred", ex);
    HttpStatus status = setStatus(ex);//from  w w  w . j  a  v  a 2s .  c o m
    JsonErrorResult error = new JsonErrorResult(status.name(), constructMessage(ex.getMessage()));
    return handleExceptionInternal(ex, error, new HttpHeaders(), status, request);
}

From source file:geniuswebsocket.NegotiationClient.java

public static void main(String[] args) throws Exception {
    if (args.length < 2) {
        System.err.println("SYNTAX: " + thisClassName
                + " <path-to-domain-folder> <url-of-negotiation-server> <game-types>");
        System.exit(1);/*from www .  j a  v a2 s  . c o  m*/
    }
    java.util.logging.Logger.getLogger("io.socket").setLevel(Level.WARNING);
    String pathToDomainFolder = args[0];
    String serverUrl = args[1];

    new NegotiationClient(new Domain(pathToDomainFolder + "/JobCandiate/JobCanDomain.xml"), serverUrl,
            "negomenus", "Candidate", "short-term", "Employer").start(); // Start the first client. It will launch new clients as the need arises.
    new NegotiationClient(new Domain(pathToDomainFolder + "/JobCandiate/JobCanDomain.xml"), serverUrl,
            "negonlp", "Candidate", "short-term", "Employer").start(); // Start the first client. It will launch new clients as the need arises.
    //      NOTE: currently we cannot play other domains, because we don't have the KBAgent configuration file: AgentConfigBneighbours_deniz.cfg
    //      new NegotiationClient(
    //         new Domain(pathToDomainFolder+"/neighbours_alex_deniz/neighbours_domain.xml"), 
    //         serverUrl, 
    //         "negomenus_neighbours", "Alex", "A",  "Deniz").start();  // Start the first client. It will launch new clients as the need arises.
}

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

public String generate(String data) {
    try {//from w  w w . j av  a  2s  . co  m
        byte[] input = toBytes(data);
        messageDigest.update(input);
        byte[] digest = messageDigest.digest();
        String checksum = toHexString1(digest);
        return checksum;
    } catch (UnsupportedEncodingException e) {
        exceptionHandler.handle(e, Level.WARNING, "Error while generating checksum", data);
        return null;
    }
}

From source file:com.aipo.app.microblog.controller.JSONController.java

@Override
protected Navigation handleError(Throwable error) throws Throwable {
    logger.log(Level.WARNING, error.getMessage(), error);
    Map<String, Object> map = Maps.newHashMap();
    String errorCode;//from w w  w  .jav  a  2 s .c om
    String errorMessage;
    int status = 500;
    boolean canRetry = false;
    if (error instanceof CapabilityDisabledException) {
        errorCode = "READONLY";
        errorMessage = "???";
    } else if (error instanceof DatastoreTimeoutException) {
        errorCode = "DSTIMEOUT";
        errorMessage = "??????";
        canRetry = true;
    } else if (error instanceof DatastoreFailureException) {
        errorCode = "DSFAILURE";
        errorMessage = "??????";
    } else if (error instanceof DeadlineExceededException) {
        errorCode = "DEE";
        errorMessage = "??????";
        canRetry = true;
    } else if (error instanceof EntityNotFoundRuntimeException) {
        status = 400;
        errorCode = "NOTFOUND";
        errorMessage = "????????";
        canRetry = true;
    } else {
        errorCode = "UNKNOWN";
        errorMessage = "??????";
    }
    map.put(STATUS, status);
    map.put(ERROR_CODE, errorCode);
    map.put(ERROR_MESSAGE, errorMessage);
    map.put(CAN_RETRY, canRetry);
    JSONObject.writeJSONString(map, response.getWriter());
    response.flushBuffer();
    return null;
}

From source file:di.uniba.it.tri.aan.AAN2file.java

private String getValue(String line) {
    int s = line.indexOf("{");
    int e = line.indexOf("}");
    if (e < 0) {
        e = line.length();/*from   ww w.ja v  a 2 s  .  c  om*/
    }
    if (e > s && s > -1 && e > -1) {
        return line.substring(s + 1, e);
    } else {
        Logger.getLogger(AAN2file.class.getName()).log(Level.WARNING, "No valid line: {0}", line);
        return null;
    }
}

From source file:net.chrissearle.spring.twitter.spring.Twitter4jTweetService.java

private void updateTwitterStatus(String text) {
    try {/*from   w w w  .  j a v a 2s .co m*/
        twitter.updateStatus(text);
    } catch (TwitterException e) {
        if (e.getMessage().indexOf("Status is a duplicate") >= 0) {
            // A duplicate post means that the tweet wanted is the latest on the timeline.
            if (logger.isLoggable(Level.INFO)) {
                logger.info("Tweet was a duplicate");
            }

            return;
        }

        final String message = new StringBuilder().append("Unable to tweet: ").append(text).append(" due to ")
                .append(e.getMessage()).toString();

        if (logger.isLoggable(Level.WARNING)) {
            logger.warning(message);
        }

        throw new TwitterServiceException(message, e);
    }
}

From source file:to.sparks.mtgox.service.SocketListener.java

@Override
public void onMessage(String string, IOAcknowledge ioa) {
    logger.log(Level.WARNING, "Message: {0}", string);
}

From source file:eu.optimis.ip.gui.client.resources.DbServerThread.java

public void startServer() {
    server.start();/*from   w  ww .  jav  a 2s.c  o m*/
    while (!isOnline()) {
        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {
            Logger.getLogger(Accounting.class.getName()).log(Level.WARNING,
                    "Error when Thread.sleep(): " + ex.getMessage());
        }
    }
}