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:puma.sp.authentication.controllers.MainController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String showWayf(HttpSession session, ModelMap model) {
    MessageManager.getInstance().addMessage(session, "info",
            "Please specify the tenant you are affiliated with");
    List<Tenant> allTenants = this.tenantService.findAll();
    model.addAttribute("tenant", new Tenant());
    model.addAttribute("tenants", allTenants);
    model.addAttribute("msgs", MessageManager.getInstance().getMessages(session));
    if (allTenants.isEmpty())
        logger.log(Level.WARNING, "No tenants could be found for providing a WAYF service");
    return "index";
}

From source file:flens.input.GraphiteInput.java

private void warn(String msg, String line) {
    Logger.getLogger(getClass().getName()).log(Level.WARNING, "opentsdb: " + msg + " [ " + line + "]");

}

From source file:com.qualogy.qafe.business.resource.rdb.query.enhancer.SQLQueryEnhancer.java

public Query enhance(Query query, DatabaseMetaData databaseMetaData) throws EnhancementFailedException {
    SQLQuery sqlQuery = (SQLQuery) query;

    ResultSet resultSet = null;//from   ww  w. ja  v a 2  s .c  o m

    try {
        if (StringUtils.isBlank(sqlQuery.getSqlAsAttribute()) && StringUtils.isBlank(sqlQuery.getSqlAsText())
                && StringUtils.isNotBlank(sqlQuery.getTable())) {
            // The Oracle database stores its table names as Upper-Case,
            // if you pass a table name in lowercase characters, it will not work.
            // MySQL database does not care if table name is uppercase/lowercase.
            //
            // TODO:check if there is a way to catch table data
            // TODO: dialect needed for upper/lowercase
            String userName = databaseMetaData.getUserName();
            resultSet = databaseMetaData.getTables(null, null, sqlQuery.getTable().toUpperCase(), null);

            String tableSchema = null;

            // Knowing schema name is not necessary but we gain performance
            // by using it during retrieving meta data.
            while (resultSet.next() && (null != userName)) {
                // some vendors like MySQL do not provide schema name
                // that's why we have to check whether the schema name is "null"
                if ((null != resultSet.getString("TABLE_SCHEM"))
                        && resultSet.getString("TABLE_SCHEM").equals(userName)) {
                    tableSchema = userName;

                    break;
                }

                // TABLE_TYPE
            }

            try {
                sqlQuery.getMetaData().setSupportsGetGeneratedKeys(databaseMetaData.supportsGetGeneratedKeys());
            } catch (AbstractMethodError e) {
                LOG.log(Level.WARNING,
                        "On the database driver there is no support for Metadata reading (sqlquery: "
                                + sqlQuery.getId() + ")",
                        e);
            }

            // if you pass null values for the first two parameters, then
            // it might take too long to return the result.
            resultSet = databaseMetaData.getPrimaryKeys(null, tableSchema, sqlQuery.getTable().toUpperCase());

            while (resultSet.next()) {
                sqlQuery.getMetaData().addPrimaryKey(resultSet.getString("COLUMN_NAME"));
            }

            // if no primarykeys found on a table, an update statement cannot be generated
            // so the query will be marked as error containing.
            sqlQuery.validate();
        }
    } catch (SQLException e) {
        throw new EnhancementFailedException(e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
                throw new EnhancementFailedException(e);
            }
        }
    }

    return sqlQuery;
}

From source file:net.nifheim.beelzebu.coins.common.utils.FileManager.java

public void copy(InputStream in, File file) {
    try {/*from  w  ww.j  a  v  a2s  .  com*/
        OutputStream out = new FileOutputStream(file);
        byte[] buf = new byte[1024];
        int len;
        while ((len = in.read(buf)) > 0) {
            out.write(buf, 0, len);
        }
        out.close();
        in.close();
    } catch (IOException e) {
        Logger.getLogger(FileManager.class.getName()).log(Level.WARNING,
                "Can''t copy the file {0} to the plugin data folder. {1}",
                new Object[] { file.getName(), e.getMessage() });
    }
}

From source file:it.unibo.alchemist.utils.L.java

/**
 * @param e//from  w  ww. j a v  a  2s .c  o  m
 *            the Throwable to get and print the stacktrace
 */
@Deprecated
public static void warn(final Throwable e) {
    log(Level.WARNING, ExceptionUtils.getStackTrace(e));
}

From source file:com.archivas.clienttools.arcutils.impl.adapter.DefaultStorageAdapterFactory.java

/**
 * Instance method to return the <code>StorageAdapter</code> appropriate for accessing the
 * object referenced by <code>url</code>.
 *
 * @param profile/*from w ww  . jav a2 s  .c  o  m*/
 *            -
 * @param httpClient
 *            - HCAPMoverProfile referencing the object for which a <code>StorageAdapter</code>
 *            will be returned.
 *
 * @return A <code>StorageAdapter</code> appropriate for accessing the the object referenced by
 *         <code>url</code>.
 */
public StorageAdapter getStorageAdapterInstance(AbstractProfileBase profile, AbstractHttpClient httpClient) {
    StorageAdapter adapter = null;
    if (profile == null) {
        return null;
    }

    try {
        switch (profile.getType()) {
        case HCAP2:
            adapter = new Hcap2Adapter((Hcap2Profile) profile, profile.getSSLExceptionCallback(), httpClient);
            break;
        case HCP_DEFAULT:
            adapter = new Hcp3DefaultNamespaceAdapter((Hcp3DefaultNamespaceProfile) profile,
                    profile.getSSLExceptionCallback(), httpClient);
            break;
        case HCP:
            adapter = new Hcp3AuthNamespaceAdapter((Hcp3AuthNamespaceProfile) profile,
                    profile.getSSLExceptionCallback(), httpClient);
            break;
        case HCP50:
            adapter = new Hcp5AuthNamespaceAdapter((Hcp5AuthNamespaceProfile) profile,
                    profile.getSSLExceptionCallback(), httpClient);
            break;
        case HCP60:
            adapter = new Hcp6AuthNamespaceAdapter((Hcp6AuthNamespaceProfile) profile,
                    profile.getSSLExceptionCallback(), httpClient);
            break;
        case FILESYSTEM:
            adapter = new FileSystemAdapter();
            break;
        default:
            adapter = null;
            break;
        }
    } catch (StorageAdapterException e) {
        LOG.log(Level.WARNING, "StorageAdapterException creating adapter", e);
    }

    if (adapter == null) {
        String msg = "No StorageAdapter is available for profile: " + profile.getName();
        throw new RuntimeException(msg);
    }
    return adapter;
}

From source file:com.softenido.cafedark.image.hash.ImageHashBuilder.java

public Hash buildHash(VirtualFile pf) throws FileNotFoundException, IOException, ArchiveException {
    if (pf.length() == 0) {
        return null;
    }//  ww w .  j a va  2s.co m
    InputStream in = pool.get(pf);
    try {
        BufferedImage image = ImageIO.read(in);
        if (image != null) {
            return buildHash(image);
        }
        return null;
    } catch (Exception ex) {
        Logger.getLogger(ImageHashBuilder.class.getName()).log(Level.WARNING, pf.toString(), ex);
        return null;
    } finally {
        in.close();
    }
}

From source file:edu.brown.seasr.xmluriloadercomponent.XMLURILoaderComponent.java

@Override
public void executeCallBack(ComponentContext cc) throws Exception {

    String[] urls = DataTypeParser.parseAsString(cc.getDataComponentFromInput(IN_LIST));
    System.err.println(urls.length);

    try {//from   w w w. j  a  v  a 2 s.com
        URIXMLLoader loader = new URIXMLLoader();

        for (String url : urls) {
            try {
                @SuppressWarnings("unchecked")
                List<String> lines = readLines(toInputStream(url));

                for (String line : lines) {

                    try {

                        String doc = loader.getDocString(line);
                        console.finest(doc);
                        cc.pushDataComponentToOutput(OUT_DOCS, doc);

                    } catch (Exception e) {
                        outputError(e, Level.WARNING);
                    }
                }

            } catch (Exception e) {
                outputError(e, Level.WARNING);
            }
        }

    } catch (Exception e) {
        console.log(Level.SEVERE, e.getMessage());
        throw new ComponentExecutionException(e);
    }
}

From source file:com.neophob.sematrix.core.glue.FileUtils.java

/**
 * get files by extension/*from  ww w. j av a2  s .c o  m*/
 * not recursive
 * @param path
 * @param ff
 * @return
 */
private String[] findFiles(String path, FilenameFilter ff) {
    File f = new File(path);
    if (!f.isDirectory()) {
        LOG.log(Level.WARNING, f + " is not a directoy");
        return null;
    }

    List<String> tmp = Arrays.asList(f.list(ff));
    Collections.sort(tmp, new SortIgnoreCase());
    return tmp.toArray(new String[tmp.size()]);
}

From source file:io.github.jeddict.jcode.util.FileUtil.java

private static ClassLoader getLoader() {
    Object is = currentLoader;/*w  w w .ja  v a 2 s.  c om*/
    if (is instanceof ClassLoader) {
        return (ClassLoader) is;
    }

    currentLoader = Thread.currentThread();

    if (loaderQuery == null) {
        loaderQuery = Lookup.getDefault().lookupResult(ClassLoader.class);
        loaderQuery.addLookupListener((LookupEvent ev) -> {
            LOG.fine("Loader cleared"); // NOI18N
            currentLoader = null;
        });
    }

    Iterator it = loaderQuery.allInstances().iterator();
    if (it.hasNext()) {
        ClassLoader toReturn = (ClassLoader) it.next();
        if (currentLoader == Thread.currentThread()) {
            currentLoader = toReturn;
        }
        LOG.log(Level.FINE, "Loader computed: {0}", currentLoader); // NOI18N
        return toReturn;
    } else {
        if (!noLoaderWarned) {
            noLoaderWarned = true;
            LOG.log(Level.WARNING, "No ClassLoader instance found in {0}", Lookup.getDefault() // NOI18N
            );
        }
        return null;
    }
}