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:to.sparks.mtgox.service.SocketListener.java

@Override
public void onDisconnect() {
    logger.log(Level.WARNING, "Disconnect");
}

From source file:org.gameontext.regsvc.db.RatingRepository.java

@PostConstruct
protected void postConstruct() {
    // Create an ObjectMapper for marshalling responses back to REST clients
    mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

    try {//w w  w .  j a va  2 s.co m
        // Ensure required views exist
        ratings = new RatingDocuments(db);

    } catch (Exception e) {
        // Log the warning, and then re-throw to prevent this class from going into service,
        // which will prevent injection to the Health check, which will make the app stay down.
        Log.log(Level.WARNING, this, "Unable to connect to database", e);
        throw e;
    }
}

From source file:com.almende.eve.algorithms.test.agents.EventAgent.java

/**
 * Receive event./*from   w  w w. j  a  va 2s. co  m*/
 *
 * @param message
 *            the message
 */
@Access(AccessType.PUBLIC)
public void receiveEvent(@Name("message") String message) {
    if (message.startsWith("report_")) {
        final String target = message.substring(7);
        if (target.equals("*") || target.equals(getId())) {
            try {
                caller.call(URIUtil.create("local:0"), "reportEventReceived", null);
            } catch (IOException e) {
                LOG.log(Level.WARNING, "Couldn't send report?", e);
            }
        }
    }
}

From source file:br.com.blackhouse.internet.controller.LoginController.java

/**
 * Returns true if user exist else false
 * //from  w  w  w. java2  s.c  o  m
 * @param userName
 *            user name
 * @param password
 *            user password
 * @return true if user exist else false
 */
@Transactional
public Usuario checkLogin(String userName, String password) {
    if (GenericValidator.isBlankOrNull(userName) || GenericValidator.isBlankOrNull(password)) {
        logger.log(Level.WARNING, "UserName and Password is null");

        return null;
    }

    Query query = entityManager.createQuery(
            "select p from Usuario p where  " + "p.userName=:userName and " + "p.password=:password");

    query.setParameter("userName", userName);
    query.setParameter("password", password);

    Usuario value = null;
    try {
        value = (Usuario) query.getSingleResult();
        value.setLastLoginDate(GregorianCalendar.getInstance().getTime());
    } catch (Exception e) {
        return null;
    }

    return value;
}

From source file:com.eschava.forevernote.ProcessNoteController.java

@RequestMapping
@ResponseBody/*from  w w  w  .j  av a 2  s  . co  m*/
public String service(@RequestParam("userId") String userId, @RequestParam("noteGuid") String noteGuid) {
    log.info("Checking note " + noteGuid + " of user " + userId);

    Objectify ofy = objectifyFactory.begin();
    LoadResult<User> userRef = ofy.load().type(User.class).id(userId);
    User user = userRef.now();
    if (user == null)
        return "";

    try {
        user.start(false);

        // todo: if note was updated - ignore next processing during one minute (use memcache)
        Note note = user.getNote(noteGuid);

        if (user.isNoteShouldBeProcessed(note))
            user.processNote(note);
    } catch (Throwable e) {
        log.log(Level.WARNING, e.getMessage(), e);

        if (e instanceof EDAMUserException
                && ((EDAMUserException) e).getErrorCode() == EDAMErrorCode.AUTH_EXPIRED) {
            user.setAuthExpired(true);
        }
    } finally {
        user.finish();
    }

    // save updated user properties anyway
    ofy.save().entity(user);

    return "";
}

From source file:io.fabric8.cxf.endpoint.JsonSchemaLookup.java

public void init() {
    LOG.log(Level.INFO, "Creating JsonSchemaLookup instance");
    try {//ww  w.j a v a 2s.c om
        if (mapper == null) {
            mapper = new ObjectMapper();

            mapper.setVisibility(new IgnorePropertiesBackedByTransientFields(mapper.getVisibilityChecker()));

            JaxbAnnotationModule module1 = new JaxbAnnotationModule();
            mapper.registerModule(module1);

            BeanValidationAnnotationModule module2 = new BeanValidationAnnotationModule();
            mapper.registerModule(module2);

        }
        // now lets expose the mbean...
        singleton = this;
    } catch (Exception e) {
        LOG.log(Level.WARNING, "Exception during initialization: ", e);
        throw new RuntimeException(e);
    }
}

From source file:com.almende.eve.transport.http.DebugServlet.java

@Override
public void init(final ServletConfig config) throws ServletException {
    final String servletUrl = config.getInitParameter("ServletUrl");
    if (servletUrl != null) {
        try {//ww w .  j a  v  a 2  s . co  m
            myUrl = new URI(servletUrl);
        } catch (final URISyntaxException e) {
            LOG.log(Level.WARNING, "Couldn't init servlet, url invalid. ('ServletUrl' init param)", e);
        }
    } else {
        LOG.warning("Servlet init parameter 'ServletUrl' is required!");
    }
    super.init(config);
}

From source file:com.almende.eve.transport.amqp.AmqpTransport.java

/**
 * Instantiates a new AMQP transport.//from w  ww  .jav a  2 s .  c om
 *
 * @param config
 *            the config
 * @param newHandle
 *            the new handle
 * @param amqpService
 *            the amqp service
 */
public AmqpTransport(AmqpTransportConfig config, Handler<Receiver> newHandle, AmqpService amqpService) {
    super(URIUtil.create("amqp:" + config.getId()), newHandle, amqpService, config);
    myId = config.getId();
    factory = new ConnectionFactory();
    try {
        factory.setUri(config.getHostUri());
    } catch (KeyManagementException | NoSuchAlgorithmException | URISyntaxException e) {
        LOG.log(Level.WARNING, "AMQP initialisation problem", e);
    }

}

From source file:com.skcraft.launcher.launch.JavaRuntimeFetcher.java

public File findJRE() {
    File runtime = getRuntimeDir();
    if (runtime == null) {
        log.log(Level.INFO, "Could not detect runtime dir on platform {0}",
                Environment.getInstance().getPlatform());
        return null;
    }//from   www . j  av  a  2 s.  co  m

    log.log(Level.INFO, "Detected runtime dir: {0}, exists: {1}", new Object[] { runtime, runtime.exists() });

    File x64 = resolve(runtime, "jre-x64");
    File jre = getLatestJRE(x64);
    if (jre == null || !jre.isDirectory()) {
        installJRE();
    }

    jre = getLatestJRE(x64);
    if (jre == null || !jre.isDirectory()) {
        log.log(Level.WARNING, "Could not locate JRE in: {0}, exists: {1}", new Object[] { x64, x64.exists() });
        return null;
    }

    boolean root = containsAll(jre, "license", "welcome");
    boolean bin = containsAll(new File(jre, "bin"), "java");
    boolean lib = containsAll(new File(jre, "lib"), "rt", "resources", "charsets");
    if (!root || !bin || !lib) {
        log.log(Level.WARNING, "Incomplete JRE installation detected in: {0}", new Object[] { jre });
        installJRE();
        jre = getLatestJRE(x64);
        if (jre == null) {
            log.log(Level.WARNING, "Could not locate JRE in: {0}, exists: {1}",
                    new Object[] { x64, x64.exists() });
            return null;
        }
    }

    log.log(Level.INFO, "Detected JRE: {0}", jre);

    if (!resolve(jre, "bin", "java").setExecutable(true)) {
        log.log(Level.WARNING, "Unable to make 'java' executable!");
    }

    if (!resolve(jre, "bin", "javaw").setExecutable(true)) {
        log.log(Level.WARNING, "Unable to make 'javaw' executable!");
    }

    return resolve(jre, "bin");
}

From source file:com.nebel_tv.content.api.ContentWrapper.java

@Override
public WrapperResponse getMediaData(String url) {

    try {/*from w ww  . jav  a 2  s.  c o m*/
        String name = getUrlLastSegment(url);
        IWrapperMethod method = WrapperMethodFactory.getMethodByName(name);

        if (method != null) {
            List<NameValuePair> pairs = URLEncodedUtils.parse(new URI(url), "UTF-8");

            Map<String, String> params = new HashMap<String, String>();
            for (NameValuePair param : pairs) {
                params.put(param.getName(), param.getValue());
            }
            return method.execute(params);
        }
    } catch (URISyntaxException ex) {
        Logger.getLogger(ContentWrapper.class.getName()).log(Level.WARNING, null, ex);
    } catch (InvalidParameterException ex) {
        Logger.getLogger(ContentWrapper.class.getName()).log(Level.SEVERE, null, ex);

        return new WrapperResponse(ResponseResult.InvalidParams, ResponseType.Content, "");
    }
    return new WrapperResponse(ResponseResult.InvalidUrl, ResponseType.Content, "");
}