@Override public void registerDestructionCallback(String name, Runnable callback, int scope) { if (logger.isWarnEnabled()) { logger.warn("Could not register destruction callback [" + callback + "] for attribute '" + name + "' because FacesRequestAttributes does not support such callbacks"); } }
/** * Determine whether to log the given exception coming from a * {@link ObjectMapper#canDeserialize} / {@link ObjectMapper#canSerialize} check. * @param type the class that Jackson tested for (de-)serializability * @param cause the Jackson-thrown exception to evaluate * (typically a {@link JsonMappingException}) * @since 4.3 */ protected void logWarningIfNecessary(Type type, @Nullable Throwable cause) { if (cause == null) { return; } // Do not log warning for serializer not found (note: different message wording on Jackson 2.9) boolean debugLevel = (cause instanceof JsonMappingException && cause.getMessage().startsWith("Cannot find")); if (debugLevel ? logger.isDebugEnabled() : logger.isWarnEnabled()) { String msg = "Failed to evaluate Jackson " + (type instanceof JavaType ? "de" : "") + "serialization for type [" + type + "]"; if (debugLevel) { logger.debug(msg, cause); } else if (logger.isDebugEnabled()) { logger.warn(msg, cause); } else { logger.warn(msg + ": " + cause); } } }
@Override public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { LifecycleMetadata metadata = findLifecycleMetadata(bean.getClass()); try { metadata.invokeDestroyMethods(bean, beanName); } catch (InvocationTargetException ex) { String msg = "Destroy method on bean with name '" + beanName + "' threw an exception"; if (logger.isDebugEnabled()) { logger.warn(msg, ex.getTargetException()); } else { logger.warn(msg + ": " + ex.getTargetException()); } } catch (Throwable ex) { logger.warn("Failed to invoke destroy method on bean with name '" + beanName + "'", ex); } }
if (!xformTemplates.isEmpty()) { if (xformTemplates.containsKey(xformKey)) { buildXFormVals.addAll(Arrays.asList(xformTemplates.get(xformKey).split(","))); classPool = ClassPool.getDefault(); clazz = classPool.makeClass(new ByteArrayInputStream(classfileBuffer), false); logger.warn(convertedClassName + " has already been transformed by a previous instance of DirectCopyTransfomer. " + "Skipping this annotation based transformation. Generally, annotation-based transformation is handled " + "by bean id blAnnotationDirectCopyClassTransformer with template tokens being added to " + logger.debug(String.format("[%s] - Transform - Copying into [%s] from [%s]", LifeCycleEvent.END, xformKey, StringUtils.join(xformVals, ","))); logger.debug(String.format("Adding interface [%s]", i.getName())); clazz.addInterface(i); for (CtField field : fieldsToCopy) { if (field.hasAnnotation(NonCopied.class)) { logger.debug(String.format("Not adding field [%s]", field.getName())); } else { try {
@Override public void reportReservedPort(String host, int port, String role, int index) { if (this.clusterDef.keySet().contains(role)) { this.clusterDef.get(role).add(new ContainerHostPair(index, host + ":" + port)); LOG.info("Received reserved port report from " + host + " role is " + role + " reserved port is " + port); } else { LOG.warn("Unknow role " + role + " reported from " + host); } }
public void handleStatus(String serviceName, ServiceStatusType status) { if (status.equals(ServiceStatusType.DOWN)) { LOG.error(serviceName + " is reporting a status of DOWN"); } else if (status.equals(ServiceStatusType.PAUSED)) { LOG.warn(serviceName + " is reporting a status of PAUSED"); } else { LOG.info(serviceName + " is reporting a status of UP"); } }
/** * Check the UserTransaction as well as the TransactionManager handle, * assuming standard JTA requirements. * @throws IllegalStateException if no sufficient handles are available */ protected void checkUserTransactionAndTransactionManager() throws IllegalStateException { // We at least need the JTA UserTransaction. if (this.userTransaction != null) { if (logger.isDebugEnabled()) { logger.debug("Using JTA UserTransaction: " + this.userTransaction); } } else { throw new IllegalStateException("No JTA UserTransaction available - specify either " + "'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transactionManagerName'"); } // For transaction suspension, the JTA TransactionManager is necessary too. if (this.transactionManager != null) { if (logger.isDebugEnabled()) { logger.debug("Using JTA TransactionManager: " + this.transactionManager); } } else { logger.warn("No JTA TransactionManager found: transaction suspension not available"); } }
public static void logVersion() { if (!printed) { printed = true; LogFactory.getLog(Version.class).info("Elasticsearch Hadoop " + version()); // Check java version String javaVersion = System.getProperty("java.version"); if (javaVersion.startsWith("1.")) { if (!javaVersion.startsWith("1.8.")) { LogFactory.getLog(Version.class).warn("Using java version " + javaVersion + " is deprecated in Elasticsearch Hadoop"); } } } } }
logger.info("Default sql-error-codes.xml not found (should be included in spring-jdbc jar)"); if (resource != null && resource.exists()) { bdr.loadBeanDefinitions(resource); logger.debug("Found custom sql-error-codes.xml file at the root of the classpath"); logger.warn("Error loading SQL error codes from config file", ex); errorCodes = Collections.emptyMap();
public static void setPathExecutableRecursively(String path) { File file = new File(path); if (!file.exists()) { LOG.warn("Path " + path + " does not exist!"); return; } if (!file.setExecutable(true)) { LOG.error("Failed to set executable for " + path); } if (file.isDirectory()) { File[] files = file.listFiles(); if (null != files && files.length > 0) { setPathExecutableRecursively(file.getAbsolutePath()); } } }
private void callFailedListener(SpringApplicationRunListener listener, ConfigurableApplicationContext context, Throwable exception) { try { listener.failed(context, exception); } catch (Throwable ex) { if (exception == null) { ReflectionUtils.rethrowRuntimeException(ex); } if (this.log.isDebugEnabled()) { this.log.error("Error handling failed", ex); } else { String message = ex.getMessage(); message = (message != null) ? message : "no error message"; this.log.warn("Error handling failed (" + message + ")"); } } }
fail("should not get to this stage"); } catch (BKTransmitException bkte) { LOG.debug("Error writing to bookkeeper", bkte); assertEquals("Invalid exception message", BKException.Code.NotEnoughBookiesException, bkte.getBKResultCode()); LOG.error("Exception in test", e); throw e; } finally { LOG.warn("Not all bookies from this test shut down, expect errors");
if (logger.isWarnEnabled()) { logger.warn("Error while accessing table meta-data results: " + ex.getMessage()); logger.info("Unable to locate table meta-data for '" + tableName + "': column names must be provided");
/** * Refresh the connection and retry the MBean invocation if possible. * <p>If not configured to refresh on connect failure, this method * simply rethrows the original exception. * @param invocation the invocation that failed * @param ex the exception raised on remote invocation * @return the result value of the new invocation, if succeeded * @throws Throwable an exception raised by the new invocation, * if it failed as well * @see #setRefreshOnConnectFailure * @see #doInvoke */ @Nullable protected Object handleConnectFailure(MethodInvocation invocation, Exception ex) throws Throwable { if (this.refreshOnConnectFailure) { String msg = "Could not connect to JMX server - retrying"; if (logger.isDebugEnabled()) { logger.warn(msg, ex); } else if (logger.isWarnEnabled()) { logger.warn(msg); } prepare(); return doInvoke(invocation); } else { throw ex; } }
if (!(message.getPayload() instanceof byte[])) { if (logger.isErrorEnabled()) { logger.error("Expected byte[] payload. Ignoring " + message + "."); if (accessor.getSubscriptionId() == null && logger.isWarnEnabled()) { logger.warn("No STOMP \"subscription\" header in " + message);
@Override public void log(final Level level, final String message, final Throwable throwable) { switch (level) { case TRACE: logger.trace(message, throwable); break; case DEBUG: logger.debug(message, throwable); break; case INFO: logger.info(message, throwable); break; case WARN: logger.warn(message, throwable); break; case ERROR: logger.error(message, throwable); break; } }
/** * Determine whether to log the given exception coming from a * {@link ObjectMapper#canDeserialize} / {@link ObjectMapper#canSerialize} check. * @param type the class that Jackson tested for (de-)serializability * @param cause the Jackson-thrown exception to evaluate * (typically a {@link JsonMappingException}) * @since 4.3 */ protected void logWarningIfNecessary(Type type, @Nullable Throwable cause) { if (cause == null) { return; } // Do not log warning for serializer not found (note: different message wording on Jackson 2.9) boolean debugLevel = (cause instanceof JsonMappingException && cause.getMessage().startsWith("Cannot find")); if (debugLevel ? logger.isDebugEnabled() : logger.isWarnEnabled()) { String msg = "Failed to evaluate Jackson " + (type instanceof JavaType ? "de" : "") + "serialization for type [" + type + "]"; if (debugLevel) { logger.debug(msg, cause); } else if (logger.isDebugEnabled()) { logger.warn(msg, cause); } else { logger.warn(msg + ": " + cause); } } }
String[] customCriteria = persistencePackage.getCustomCriteria(); if (customCriteria != null && customCriteria.length > 0) { LOG.warn("custom persistence handlers and custom criteria not supported for update types other than BASIC"); MapStructure mapStructure = (MapStructure) persistencePerspective.getPersistencePerspectiveItems().get(PersistencePerspectiveItemType.MAPSTRUCTURE); if (!mapStructure.getMutable()) { throw new SecurityServiceException("Field not mutable"); LOG.debug("No key property passed in for map, failing validation"); Serializable valueInstance = (Serializable) map.get(entity.findProperty("priorKey").getValue()); if (map.get(mapKey) != null && !map.get(mapKey).equals(valueInstance)) { entity.addValidationError(mapStructure.getKeyPropertyName(), "keyExistsValidationError");
private void initFactories(List<RoutePredicateFactory> predicates) { predicates.forEach(factory -> { String key = factory.name(); if (this.predicates.containsKey(key)) { this.logger.warn("A RoutePredicateFactory named "+ key + " already exists, class: " + this.predicates.get(key) + ". It will be overwritten."); } this.predicates.put(key, factory); if (logger.isInfoEnabled()) { logger.info("Loaded RoutePredicateFactory [" + key + "]"); } }); }