Example usage for org.apache.commons.lang UnhandledException UnhandledException

List of usage examples for org.apache.commons.lang UnhandledException UnhandledException

Introduction

In this page you can find the example usage for org.apache.commons.lang UnhandledException UnhandledException.

Prototype

public UnhandledException(String message, Throwable cause) 

Source Link

Document

Constructs the exception using a message and cause.

Usage

From source file:org.displaytag.tags.TableTagBeanInfo.java

/**
 * @see java.beans.BeanInfo#getPropertyDescriptors()
 *///from w  ww  . j a  v a  2s.co m
public PropertyDescriptor[] getPropertyDescriptors() {
    List proplist = new ArrayList();

    try {
        proplist.add(new PropertyDescriptor("cellpadding", //$NON-NLS-1$
                TableTag.class, null, "setCellpadding")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("cellspacing", //$NON-NLS-1$
                TableTag.class, null, "setCellspacing")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$
                TableTag.class, null, "setClass")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$
                TableTag.class, null, "setDecorator")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$
                TableTag.class, null, "setDefaultorder")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("defaultsort", //$NON-NLS-1$
                TableTag.class, null, "setDefaultsort")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("export", //$NON-NLS-1$
                TableTag.class, null, "setExport")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("frame", //$NON-NLS-1$
                TableTag.class, null, "setFrame")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("length", //$NON-NLS-1$
                TableTag.class, null, "setLength")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("offset", //$NON-NLS-1$
                TableTag.class, null, "setOffset")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("pagesize", //$NON-NLS-1$
                TableTag.class, null, "setPagesize")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("partialList", //$NON-NLS-1$
                TableTag.class, null, "setPartialList")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("requestURI", //$NON-NLS-1$
                TableTag.class, null, "setRequestURI")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("requestURIcontext", //$NON-NLS-1$
                TableTag.class, null, "setRequestURIcontext")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("rules", //$NON-NLS-1$
                TableTag.class, null, "setRules")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("sort", //$NON-NLS-1$
                TableTag.class, null, "setSort")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$
                TableTag.class, null, "setStyle")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("summary", //$NON-NLS-1$
                TableTag.class, null, "setSummary")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("excludedParams", //$NON-NLS-1$
                TableTag.class, null, "setExcludedParams")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("id", //$NON-NLS-1$
                TableTag.class, null, "setUid")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("uid", //$NON-NLS-1$
                TableTag.class, null, "setUid")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("htmlId", //$NON-NLS-1$
                TableTag.class, null, "setHtmlId")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("varTotals", //$NON-NLS-1$
                TableTag.class, null, "setVarTotals")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("keepStatus", //$NON-NLS-1$
                TableTag.class, null, "setKeepStatus")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("clearStatus", //$NON-NLS-1$
                TableTag.class, null, "setClearStatus")); //$NON-NLS-1$
        proplist.add(new PropertyDescriptor("form", //$NON-NLS-1$
                TableTag.class, null, "setForm")); //$NON-NLS-1$

        // deprecated attributes
        proplist.add(new PropertyDescriptor("list", //$NON-NLS-1$
                TableTag.class, null, "setList")); //$NON-NLS-1$

        // 

        // Hexagon-added property, make the table non-customizable:
        proplist.add(new PropertyDescriptor("listTableName", TableTag.class, null, "setListTableName"));
        // Hexagon-added property, for screens with multiple tables, we need to know the db tableName:
        proplist.add(new PropertyDescriptor("nonConfigurable", TableTag.class, null, "setNonConfigurable"));

        // make ATG Dynamo happy:
        proplist.add(new PropertyDescriptor("className", //$NON-NLS-1$
                TableTag.class, null, "setClass")); //$NON-NLS-1$

        try {
            Class.forName("javax.servlet.jsp.tagext.IterationTag"); //$NON-NLS-1$
            // jsp >= 1.2
            proplist.add(new PropertyDescriptor("name", //$NON-NLS-1$
                    TableTag.class, null, "setName")); //$NON-NLS-1$
            proplist.add(new PropertyDescriptor("size", //$NON-NLS-1$
                    TableTag.class, null, "setSize")); //$NON-NLS-1$
        } catch (ClassNotFoundException e) {
            // jsp 1.1, can't use a setter with an Object parameter
            proplist.add(new PropertyDescriptor("name", //$NON-NLS-1$
                    TableTag.class, null, "setNameString")); //$NON-NLS-1$
            proplist.add(new PropertyDescriptor("size", //$NON-NLS-1$
                    TableTag.class, null, "setSizeObjectName")); //$NON-NLS-1$
        }

    } catch (IntrospectionException ex) {
        throw new UnhandledException(
                "You got an introspection exception - maybe defining a property that is not"
                        + " defined in the TableTag?: " + ex.getMessage(),
                ex);
    }

    PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
    return ((PropertyDescriptor[]) proplist.toArray(result));
}

From source file:org.eclipse.gyrex.boot.internal.app.ServerApplication.java

private void jmxOn() {
    try {/* www . j  a  v a2s .  c  o  m*/
        JettyJmxConnector.start();
    } catch (final ClassNotFoundException e) {
        LOG.warn("Jetty JMX is not available. Please configure JMX support manually. ({})", e.getMessage());
    } catch (final LinkageError e) {
        LOG.warn("Jetty JMX is not available. Please configure JMX support manually. ({})", e.getMessage());
    } catch (final Exception e) {
        throw new UnhandledException(
                "An error occured while starting the embedded JMX server. Please verify the port/host configuration is correct and no other server is running. JMX can also be disabled by setting system property 'gyrex.jmxrmi.skip'.",
                e);
    }
}

From source file:org.mule.module.magento.api.catalog.AxisMagentoCatalogClient.java

private String encodeStream(InputStream content) {
    try {//from  w w w  . jav  a  2 s  .c  o  m
        return Base64.encodeBytes(IOUtils.toByteArray(content));
    } catch (IOException e) {
        throw new UnhandledException("Could not encode the stream", e);
    } finally {
        IOUtils.closeQuietly(content);
    }
}

From source file:org.mule.providers.jcr.JcrConnector.java

public Session validateSession(Session session) {
    if ((session != null) && (session.isLive())) {
        return session;
    } else {/*from   w w w.  j av a2 s. c o  m*/
        logger.info("JCR session is invalid: a new one will be created.");

        try {
            return newSession();
        } catch (RepositoryException re) {
            logger.error("Impossible to reconnect to the JCR container!", re);

            if (connectionStrategy != null) {
                initialised.set(false);

                try {
                    stopConnector();
                } catch (UMOException umoe) {
                    logger.warn(umoe.getMessage(), umoe);
                }

                try {
                    connectionStrategy.connect(this);
                    initialise();
                    startConnector();
                    return session;

                } catch (FatalConnectException fce) {
                    throw new IllegalStateException("Failed to reconnect to JCR server. I'm giving up.");
                } catch (UMOException umoe) {
                    throw new UnhandledException("Failed to recover a connector.", umoe);
                }

            } else {
                throw new IllegalStateException("Connection to the JCR container has been lost "
                        + "and no connection strategy has been defined on the connector!");
            }
        }
    }
}

From source file:org.tamilunicodeconverter.converter.BaminiConverter.java

public String getUnicodeTextUsingJavaScript(String text) {
    String unicodeText = "";

    try {/*from w  w  w. j ava2 s . c o  m*/
        ScriptEngineManager factory = new ScriptEngineManager();
        ScriptEngine engine = factory.getEngineByName("JavaScript");
        engine.eval(getScriptContent());
        Invocable invokable = (Invocable) engine;
        unicodeText = (String) invokable.invokeFunction("convert", new String[] { text });
    } catch (Exception ex) {
        throw new UnhandledException("Error occured while converting bamini text to unicode", ex);
    }
    return unicodeText;
}

From source file:org.tamilunicodeconverter.extractor.ContentExtractor.java

public String getContent(File file) {
    String content = "";
    try {//from   w ww.jav  a2s  .  c om
        TikaConfig config = TikaConfig.getDefaultConfig();
        content = ParseUtils.getStringContent(file, config);
    } catch (Exception ex) {
        throw new UnhandledException("Error occured while extracting content from the file " + file, ex);
    }
    return content;
}