List of usage examples for java.util.logging Level WARNING
Level WARNING
To view the source code for java.util.logging Level WARNING.
Click Source Link
From source file:com.googlecode.jsonrpc4j.DefaultExceptionResolver.java
/** * {@inheritDoc}//from w w w .j av a 2s.c om */ public Throwable resolveException(ObjectNode response) { // get the error object ObjectNode errorObject = ObjectNode.class.cast(response.get("error")); // bail if we don't have a data object if (!errorObject.has("data") || errorObject.get("data").isNull() || !errorObject.get("data").isObject()) { return createJsonRpcClientException(errorObject); } // get the data object ObjectNode dataObject = ObjectNode.class.cast(errorObject.get("data")); // bail if it's not the expected format if (!dataObject.has("exceptionTypeName") || dataObject.get("exceptionTypeName") == null || dataObject.get("exceptionTypeName").isNull() || !dataObject.get("exceptionTypeName").isTextual()) { return createJsonRpcClientException(errorObject); } // get values String exceptionTypeName = dataObject.get("exceptionTypeName").asText(); String message = dataObject.has("message") && dataObject.get("message").isTextual() ? dataObject.get("message").asText() : null; // create it Throwable ret = null; try { ret = createThrowable(exceptionTypeName, message); } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to create throwable", e); } // if we can't create it, create a default exception if (ret == null) { ret = createJsonRpcClientException(errorObject); } // return it return ret; }
From source file:com.subgraph.vega.internal.crawler.HttpResponseProcessor.java
private void runLoop() throws InterruptedException { while (!stop) { CrawlerTask task = crawlerResponseQueue.take(); if (task.isExitTask()) { crawlerRequestQueue.add(CrawlerTask.createExitTask()); crawlerResponseQueue.add(task); return; }/*w ww .j av a 2s . c om*/ HttpUriRequest req = task.getRequest(); activeRequest = req; try { if (task.getResponse() != null) { task.getResponseProcessor().processResponse(crawler, req, task.getResponse(), task.getArgument()); } } catch (Exception e) { logger.log(Level.WARNING, "Unexpected exception processing crawler request: " + req.getURI(), e); } finally { synchronized (requestLock) { activeRequest = null; } final HttpEntity entity = (task.getResponse() == null) ? (null) : task.getResponse().getRawResponse().getEntity(); if (entity != null) try { EntityUtils.consume(entity); } catch (IOException e) { logger.log(Level.WARNING, "I/O exception consuming request entity content for " + req.getURI() + " : " + e.getMessage()); } } synchronized (counter) { counter.addCompletedTask(); crawler.updateProgress(); } if (task.causedException()) { crawler.notifyException(req, task.getException()); } if (outstandingTasks.decrementAndGet() <= 0) { crawlerRequestQueue.add(CrawlerTask.createExitTask()); crawlerResponseQueue.add(CrawlerTask.createExitTask()); return; } } }
From source file:de.hofuniversity.iisys.neo4j.websock.query.encoding.unsafe.DeflateJsonQueryHandler.java
public DeflateJsonQueryHandler(final String compression) { fLogger = Logger.getLogger(this.getClass().getName()); fDebug = (fLogger.getLevel() == Level.FINEST); fInflater = new Inflater(true); int tmpComp = DEFAULT_COMPRESSION_LEVEL; if (WebsockConstants.FASTEST_COMPRESSION.equals(compression)) { tmpComp = Deflater.BEST_SPEED; } else if (WebsockConstants.BEST_COMPRESSION.equals(compression)) { tmpComp = Deflater.BEST_COMPRESSION; } else {//from www .j a v a 2s . c o m fLogger.log(Level.WARNING, "unknown compression level '" + compression + "'; using default."); } fCompression = tmpComp; }
From source file:org.osiam.addons.selfadministration.exception.OsiamExceptionHandler.java
@ExceptionHandler(RuntimeException.class) protected ModelAndView handleException(RuntimeException ex, HttpServletResponse response) { LOGGER.log(Level.WARNING, AN_EXCEPTION_OCCURED, ex); response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); modelAndView.addObject(KEY, "registration.exception.message"); setLoggingInformation(ex);/*from w ww . j av a 2s .com*/ return modelAndView; }
From source file:net.daboross.bukkitdev.skywars.util.CrossVersion.java
/** * Supports Bukkit earlier than 1.6. TODO: removable? *//* ww w . j a v a 2s. c o m*/ public static double getMaxHealth(Damageable d) { Validate.notNull(d, "Damageable cannot be null"); try { return d.getMaxHealth(); } catch (NoSuchMethodError ignored) { Class<? extends Damageable> dClass = d.getClass(); try { Method healthMethod = dClass.getMethod("getMaxHealth"); Object obj = healthMethod.invoke(d); if (obj instanceof Number) { return ((Number) obj).doubleValue(); } else { SkyStatic.getLogger().log(Level.WARNING, "LivingEntity.getHealth returned {0}, which is not a Number!", obj); } } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { SkyStatic.getLogger().log(Level.WARNING, "Couldn't find / use .getMaxHealth method of LivingEntity!", ex); } return 10; } }
From source file:com.almende.eve.transport.http.HttpService.java
/** * Construct an HttpService This constructor is called when the * TransportService is constructed by the AgentHost. * // w w w .j a va2s .c o m * @param agentHost * the agent host * @param params * Available parameters: {String} servlet_url */ public HttpService(final AgentHost agentHost, final Map<String, Object> params) { host = agentHost; if (params != null) { setServletUrl((String) params.get("servlet_url")); if (params.get("servlet_launcher") != null) { String className = (String) params.get("servlet_launcher"); if (className.equals("JettyLauncher")) { className = "com.almende.eve.transport.http.embed.JettyLauncher"; } try { final Class<?> launcherClass = Class.forName(className); if (!ClassUtil.hasInterface(launcherClass, ServletLauncher.class)) { throw new IllegalArgumentException("ServletLauncher class " + launcherClass.getName() + " must implement " + ServletLauncher.class.getName()); } ServletLauncher launcher = (ServletLauncher) launcherClass.newInstance(); launcher.add(new AgentServlet(this), URI.create(getServletUrl()), agentHost.getConfig()); } catch (Exception e) { LOG.log(Level.WARNING, "Failed to load launcher!", e); } } } }
From source file:info.dolezel.jarss.rest.v1.ws.UnreadNotificationEndpoint.java
@OnWebSocketMessage public void onMessage(Session session, String text) { EntityManager em = null;/* www . java 2 s .co m*/ EntityTransaction tx = null; try { JsonReader reader; JsonObject object; Token token; em = HibernateUtil.getEntityManager(); tx = em.getTransaction(); tx.begin(); reader = Json.createReader(new StringReader(text)); object = reader.readObject(); token = Token.loadToken(em, object.getString("token")); if (token == null) { tx.rollback(); Logger.getLogger(UnreadNotificationEndpoint.class.getName()).log(Level.WARNING, "Invalid token provided over WebSocket"); session.close(); } else { synchronized (sessions) { sessions.put(session, token.getUser()); } synchronized (userSessions) { userSessions.put(token.getUser(), session); } } tx.commit(); } catch (Exception ex) { if (tx != null) tx.rollback(); Logger.getLogger(UnreadNotificationEndpoint.class.getName()).log(Level.SEVERE, "Error processing incoming WebSocket message", ex); } finally { if (em != null) em.close(); } }
From source file:com.qumasoft.guitools.compare.FileContentsListModel.java
FileContentsListModel(File file, CompareFilesForGUI compareResult, boolean isFirstFile, FileContentsListModel firstFileListModel) { super();/*w w w. j ava 2 s . com*/ this.currentDifferenceIndex = -1; BufferedReader fileReader = null; if (file.canRead()) { try { fileReader = new BufferedReader(new FileReader(file)); int lineIndex = 0; while (true) { String line = fileReader.readLine(); if (line == null) { break; } String formattedLine = formatLine(line); ContentRow row = new ContentRow(formattedLine, line, compareResult, lineIndex, isFirstFile); if (!isFirstFile) { // If this is the 2nd file, for replacement lines figure out where in the line things are different. if (row.getRowType() == ContentRow.ROWTYPE_REPLACE) { System.out.println("lineIndex: [" + lineIndex + "]"); ContentRow firstModelRow = firstFileListModel.get(lineIndex); row.decorateDifferences(firstModelRow); firstModelRow.decorateDifferences(row); } } if (row.getBlankRowsBefore() > 0) { for (int i = 0; i < row.getBlankRowsBefore(); i++) { addBlankRow(row.getDelta()); } } addElement(row); if (row.getBlankRowsAfter() > 0) { for (int i = 0; i < row.getBlankRowsAfter(); i++) { addBlankRow(row.getDelta()); } } lineIndex++; } } catch (java.io.FileNotFoundException e) { LOGGER.log(Level.WARNING, "Caught exception: " + e.getClass().toString() + ": " + e.getLocalizedMessage()); } catch (java.io.IOException e) { LOGGER.log(Level.WARNING, "Caught exception: " + e.getClass().toString() + ": " + e.getLocalizedMessage()); } finally { try { if (fileReader != null) { fileReader.close(); } } catch (IOException e) { LOGGER.log(Level.WARNING, "Caught exception: " + e.getClass().toString() + ": " + e.getLocalizedMessage()); } } } }
From source file:jp.zippyzip.Pref.java
/** * JSON ??/*w w w . j a va2s .co m*/ * * @returnJSON */ public String toJson() { String ret = null; try { ret = new JSONStringer().object().key("code").value(code).key("name").value(name).key("yomi") .value(yomi).endObject().toString(); } catch (JSONException e) { log.log(Level.WARNING, "", e); } return ret; }
From source file:de.themoep.simpleteampvp.TeamInfo.java
/** * Create a new TeamInfo object from a configuration section * @param config The configuration section which holds the info for this team *//*from w w w .j a v a 2s.c om*/ public TeamInfo(ConfigurationSection config) throws IllegalArgumentException { this(config.getName()); setColor(config.getString("color", "")); setBlock(config.getString("block", "")); displayName = config.getString("displayname", ""); ConfigurationSection spawnSection = config.getConfigurationSection("spawn"); if (spawnSection != null) { spawn = new LocationInfo(spawnSection); } else { Bukkit.getLogger().log(Level.WARNING, "Team " + config.getName() + " does not have a spawn location defined!"); } ConfigurationSection pointSection = config.getConfigurationSection("point"); if (pointSection != null) { point = new LocationInfo(pointSection); } ConfigurationSection pos1Section = config.getConfigurationSection("region.pos1"); ConfigurationSection pos2Section = config.getConfigurationSection("region.pos2"); if (pos1Section != null && pos2Section != null) { region = new RegionInfo(new LocationInfo(pos1Section), new LocationInfo(pos2Section)); } ConfigurationSection joinPos1Section = config.getConfigurationSection("joinregion.pos1"); ConfigurationSection joinPos2Section = config.getConfigurationSection("joinregion.pos2"); if (joinPos1Section != null && joinPos2Section != null) { joinRegion = new RegionInfo(new LocationInfo(joinPos1Section), new LocationInfo(joinPos2Section)); } else { Bukkit.getLogger().log(Level.WARNING, "Team " + config.getName() + " does not have a join region defined!"); } }