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.almende.eve.test.TestRpc.java

/**
 * Test me./*from   w  ww. jav  a 2s. c  o  m*/
 *
 * @throws JsonProcessingException
 *             the json processing exception
 */
@Test
public void testRpc() throws JsonProcessingException {
    final JSONRpcProtocolConfig params = new JSONRpcProtocolConfig();
    params.setId("me");

    final JSONRpcProtocol protocol = new JSONRpcProtocolBuilder().withConfig(params)
            .withHandle(new SimpleHandler<Object>(new MyClass())).build();

    final AsyncCallback<Boolean> callback = new AsyncCallback<Boolean>() {

        @Override
        public void onSuccess(final Boolean result) {
            LOG.warning("Success!");
            assertTrue(result);
        }

        @Override
        public void onFailure(final Exception exception) {
            LOG.log(Level.WARNING, "Expected exception:", exception);
        }

    };

    final Params parms = new Params();
    parms.add("parm", true);
    Object request = new JSONRequest("testMe", parms, callback);

    final URI myUri = URIUtil.create("local://me");
    // prepare message for transport
    Object message = protocol.outbound(request, myUri).getResult();
    // transport
    Object response = protocol.outbound(protocol.inbound(message, myUri).getResult(), myUri).getResult();
    // transport back
    protocol.inbound(response, myUri);

    request = new JSONRequest("test.testMe", parms);

    // prepare message for transport
    message = protocol.outbound(request, myUri).getResult();
    // transport
    response = protocol.outbound(protocol.inbound(message, myUri).getResult(), myUri).getResult();
    assertNull(response);

    request = new JSONRequest("failMe", parms, callback);

    // prepare message for transport
    message = protocol.outbound(request, myUri).getResult();
    // transport
    response = protocol.outbound(protocol.inbound(message, myUri).getResult(), myUri).getResult();
    protocol.inbound(response, myUri);

    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
    }

}

From source file:Classes.Database.java

private Database() {
    try {/*from  w w w.j  a v  a  2 s . com*/
        if (DatabaseConnection(url)) {
            Logger.getAnonymousLogger().log(Level.INFO, "School db connected");
        } else {
            Logger.getAnonymousLogger().log(Level.INFO, "Cannot connect to any database");
        }
    } catch (SQLException e) {
        Logger.getAnonymousLogger().log(Level.WARNING, "SQLError in Constructor: " + e.getMessage(), e);
    }
}

From source file:com.bt.download.android.gui.httpserver.DownloadHandler.java

@Override
public void handle(final HttpExchange exchange) throws IOException {
    Engine.instance().getThreadPool().execute(new Runnable() {
        @Override//from   ww  w .j av a 2s.  c  om
        public void run() {
            try {
                internalHandler(exchange);
            } catch (IOException e) {
                LOG.log(Level.WARNING, "DownloadHandler async handle error", e);
            }
        }
    });
}

From source file:com.symbian.driver.core.processors.HardwarePostProcessor.java

/**
 * @see java.lang.Thread#run()// ww  w  . j av  a 2 s .com
 */
public void run() {
    LOGGER.info("Stopping and cleaning after TestDriver.");
    try {
        Runtime.getRuntime().removeShutdownHook(this);
    } catch (Exception lException) {
        LOGGER.fine("Didn't succefully deregister the shutdownhook.");
    }

    //uninstall tef before stop communication channel
    try {
        if (iTefDeps != null) {
            TDConfig CONFIG = TDConfig.getInstance();
            boolean lPlatSec = true;
            try {
                //lPlatSec = CONFIG.isPreference(TDConfig.PLATSEC) && !CONFIG.isPreference(TDConfig.SYS_BIN);
                lPlatSec = !CONFIG.isPreference(TDConfig.SYS_BIN);
            } catch (ParseException e) {
                LOGGER.log(Level.WARNING, "Could not get the configuration for PlatSec. Defaulting to ON");
            }
            if (lPlatSec) {
                iTefDeps.uninstall();
                LOGGER.fine("TEF dependencies package was successfully removed!");
            }
        }
    } catch (TimeLimitExceededException e) {
        LOGGER.log(Level.WARNING, " Warning: TEF dependencies package " + "was not successfully removed!");
    }

    try {
        DeviceCommsProxy.getInstance().stop(false);
    } catch (Exception lException) {
        LOGGER.log(Level.SEVERE, " Error ", lException);
    }

    // Move RDebug to the results folder
    if (iRDebugThread != null) {
        LOGGER.fine("Killing RDebug.");
        iRDebugThread.setM_Life(false);
    }

    // Stop all remaing JStat Threads
    ThreadGroup lRootThread = Thread.currentThread().getThreadGroup().getParent();
    while (lRootThread.getParent() != null) {
        lRootThread = lRootThread.getParent();
    }

    // Get all threads
    Thread[] lThreads = new Thread[50];
    int lNumThreads = lRootThread.enumerate(lThreads, true);

    LOGGER.fine(
            "The root thread is: " + lRootThread.getName() + "; and has " + lNumThreads + " children threads.");

    // Find any JStat threads remaining
    for (int lIter = 0; lIter < lNumThreads; lIter++) {
        LOGGER.fine("Looking at Thread: " + lThreads[lIter].getName());
        if (lThreads[lIter].getName().indexOf("JStat") >= 0) {
            //|| lThreads[lIter].getName().indexOf("Timer") >= 0) {
            LOGGER.log(Level.SEVERE,
                    "Could not stop all JStat Threads therefore killing TestDriver. Please check your Hardware or Emulator for failures.");
        }
    }

    LOGGER.exiting(HardwarePostProcessor.class.getName(), "run");
}

From source file:jpaworkshop.presentation.CompanyBean.java

public String executeQuery() {
    results = new LinkedList<String>();
    try {//w  w w  . j  av  a 2  s  .c  om
        List resultset = companyService.executeQuery(query);

        for (Object e : resultset) {
            results.add(convertResult(e));
        }
    } catch (Exception ex) {
        logger.log(Level.WARNING, "exception while executing query: {0} {1}", new Object[] { query, ex });
        results.add("error while executing query: " + ex.getMessage());
    }

    return "ok";
}

From source file:org.osiam.addons.selfadministration.exception.OsiamExceptionHandler.java

@ExceptionHandler(OsiamRequestException.class)
protected ModelAndView handleException(OsiamRequestException ex, HttpServletResponse response) {
    LOGGER.log(Level.WARNING, AN_EXCEPTION_OCCURED, ex);
    response.setStatus(ex.getHttpStatusCode());
    modelAndView.addObject(KEY, "registration.form.error");
    setLoggingInformation(ex);/*from  ww w  . jav  a  2  s.  com*/
    return modelAndView;
}

From source file:com.nebel_tv.content.wrapper.builders.VideoAssetsBuilder.java

private void executeQuery() {
    assets = VideoAssetsCache.getAssets(id);

    if (assets == null) {
        try {/*  w  w  w. ja  v  a2s  .  c  o  m*/
            String source = ConnectionUtils.getResponseAsString(ConnectionHelper.fixURL(queryUrl));

            JSONObject root = (JSONObject) (new JSONObject(source)).get("d");
            JSONObject encodes = (JSONObject) root.get("Encodes");

            assets = (JSONArray) encodes.get("results");
            fixVidoURL();
        } catch (Exception ex) {
            Logger.getLogger(VideoAssetsBuilder.class.getName()).log(Level.WARNING, null, ex);
        }
    }
}

From source file:edu.harvard.iq.dvn.unf.Base64Encoding.java

public Base64Encoding() {
    if (!DEBUG) {
        mLog.setLevel(Level.WARNING);
    }
}

From source file:bizlogic.Sensors.java

public static void list(Connection DBcon) throws IOException, ParseException, SQLException {

    Statement st = null;//from www .  j  a va  2 s  . c  om
    ResultSet rs = null;

    try {
        st = DBcon.createStatement();
        rs = st.executeQuery("SELECT * FROM USERCONF.SENSORLIST");

    } catch (SQLException ex) {
        Logger lgr = Logger.getLogger(Sensors.class.getName());
        lgr.log(Level.SEVERE, ex.getMessage(), ex);
    }
    try {
        FileWriter sensorsFile = new FileWriter("/var/lib/tomcat8/webapps/ROOT/Records/sensors.json");
        sensorsFile.write("");
        sensorsFile.flush();

        JSONParser parser = new JSONParser();

        JSONObject Records = new JSONObject();

        JSONObject operation_Obj = new JSONObject();
        JSONObject operand_Obj = new JSONObject();
        JSONObject unit_Obj = new JSONObject();
        JSONObject name_Obj = new JSONObject();
        JSONObject ip_Obj = new JSONObject();
        JSONObject port_Obj = new JSONObject();

        int _total = 0;

        JSONArray sensorList = new JSONArray();

        while (rs.next()) {

            JSONObject sensor_Obj = new JSONObject();
            int id = rs.getInt("sensor_id");
            String operation = rs.getString("operation");
            int operand = rs.getInt("operand");
            String unit = rs.getString("unit");
            String name = rs.getString("name");
            String ip = rs.getString("IP");
            int port = rs.getInt("port");

            sensor_Obj.put("recid", id);
            sensor_Obj.put("operation", operation);
            sensor_Obj.put("operand", operand);
            sensor_Obj.put("unit", unit);
            sensor_Obj.put("name", name);
            sensor_Obj.put("IP", ip);
            sensor_Obj.put("port", port);

            sensorList.add(sensor_Obj);
            _total++;

        }
        rs.close();

        Records.put("total", _total);
        Records.put("records", sensorList);

        sensorsFile.write(Records.toJSONString());
        sensorsFile.flush();
        sensorsFile.close();
    }

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

From source file:org.jboss.arquillian.spring.persistence.datasource.ApplicationContextDataSourceProvider.java

/**
 * {@inheritDoc}//from w w w . ja  v a 2  s . c  o m
 */
@Override
public DataSource lookupDataSource(String dataSourceName) {

    try {

        // retrieves the application context
        return (DataSource) getApplicationContext().getBean(dataSourceName, DataSource.class);
    } catch (BeansException e) {

        log.log(Level.WARNING,
                String.format("The data source with name '%s' could not be lookup due to an unexpected error.",
                        dataSourceName),
                e);

        return null;
    }
}