Example usage for java.lang StackOverflowError getMessage

List of usage examples for java.lang StackOverflowError getMessage

Introduction

In this page you can find the example usage for java.lang StackOverflowError getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.gargoylesoftware.htmlunit.javascript.regexp.HtmlUnitRegExpProxy.java

/**
 * Use the wrapped proxy except for replacement with string arg where it uses Java regular expression.
 * {@inheritDoc}/* ww w . j a v a2  s. co  m*/
 */
@Override
public Object action(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args,
        final int actionType) {
    try {
        return doAction(cx, scope, thisObj, args, actionType);
    } catch (final StackOverflowError e) {
        // TODO: We shouldn't have to catch this exception and fall back to Rhino's regex support!
        // See HtmlUnitRegExpProxyTest.stackOverflow()
        LOG.warn(e.getMessage(), e);
        return wrapped_.action(cx, scope, thisObj, args, actionType);
    }
}

From source file:de.knowwe.jspwiki.JSPWikiConnector.java

@Override
public boolean userCanEditArticle(String title, HttpServletRequest request) {
    if (ReadOnlyManager.isReadOnly())
        return false;
    WikiPage page = new WikiPage(engine, title);
    WikiContext context = new WikiContext(this.engine, request, this.engine.getPage(title));

    AuthorizationManager authmgr = engine.getAuthorizationManager();
    //noinspection SynchronizationOnLocalVariableOrMethodParameter
    synchronized (authmgr) {
        PagePermission pp = PermissionFactory.getPagePermission(page, "edit");
        try {/*  www. jav a 2  s  .c o m*/
            return authmgr.checkPermission(context.getWikiSession(), pp);
        } catch (StackOverflowError e) {
            // happens with very large articles
            Log.severe("StackOverflowError while checking permissions on article '" + title + "': "
                    + e.getMessage());
            return false;
        }
    }
}

From source file:pl.nask.hsn2.service.urlfollower.WebClientWorker.java

private void addRequiredAttributesToCurrentContext(ProcessedPage processedPage, String reasonFailed)
        throws ParameterException, ResourceException, StorageException {
    try {//from w  ww.j  av  a2s.c  o m
        RequestWrapper requestWrapper = composeRequest(processedPage);
        long referenceId = ctx.saveInDataStore(requestWrapper);
        ctx.addReference("http_request", referenceId);
        String referrer = ctx.getCurrentContextServiceData().getInputReferrer();
        if (referrer != null) {
            ctx.addAttribute("referrer", referrer);
        }

        boolean isSuccessfull = processedPage != null && processedPage.isComplete();
        ctx.addAttribute("active", isSuccessfull);
        if (isSuccessfull) {
            addAttrsForSuccessfulProcessing(processedPage);
        } else {
            addAttrsForFailedProcessing(reasonFailed);
        }
    } catch (StackOverflowError e) {
        ctx.addWarning("Serious problem with JVM - cannot recover task");
    } catch (NullPointerException e) {
        LOGGER.error("NPE while processing task", e);
        String msg = e.getMessage();
        if (msg == null) {
            String url = ctx.getCurrentContextServiceData() != null
                    ? ctx.getCurrentContextServiceData().getUrlForProcessing()
                    : null;
            msg = "NullPointerException while processing " + url;
        }
        ctx.addAttribute("reason_failed", msg);
    }
}

From source file:io.personium.core.bar.BarFileReadRunner.java

/**
 * 00_$metadata_xml??????./*from  w  w  w.  jav  a 2  s. c o m*/
 * @param entryName ??
 * @param inputStream 
 * @param davCmp Collection?
 * @return ????true
 */
protected boolean registUserSchema(String entryName, InputStream inputStream, DavCmp davCmp) {
    EdmDataServices metadata = null;
    // XML(StAX,SAX,DOM)?InputStream???????????
    // ?????????????????
    try {
        InputStreamReader isr = new InputStreamReader(new CloseShieldInputStream(inputStream));
        // 00_$metadata.xml????
        XMLFactoryProvider2 provider = StaxXMLFactoryProvider2.getInstance();
        XMLInputFactory2 factory = provider.newXMLInputFactory2();
        XMLEventReader2 reader = factory.createXMLEventReader(isr);
        PersoniumEdmxFormatParser parser = new PersoniumEdmxFormatParser();
        metadata = parser.parseMetadata(reader);
    } catch (Exception ex) {
        log.info("XMLParseException: " + ex.getMessage(), ex.fillInStackTrace());
        String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2002");
        writeOutputStream(true, "PL-BI-1004", entryName, message);
        return false;
    } catch (StackOverflowError tw) {
        // ComplexType???StackOverFlowError??
        log.info("XMLParseException: " + tw.getMessage(), tw.fillInStackTrace());
        String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2002");
        writeOutputStream(true, "PL-BI-1004", entryName, message);
        return false;
    }
    // Entity/Property?
    // Property/ComplexProperty????ComplexType???????
    // ??ComplexType????EntityType?
    // PersoniumODataProducer producer = davCmp.getODataProducer();
    try {
        createComplexTypes(metadata, davCmp);
        createEntityTypes(metadata, davCmp);
        createAssociations(metadata, davCmp);
    } catch (PersoniumCoreException e) {
        writeOutputStream(true, "PL-BI-1004", entryName, e.getMessage());
        log.info("PersoniumCoreException: " + e.getMessage());
        return false;
    } catch (Exception e) {
        log.info("Regist Entity Error: " + e.getMessage(), e.fillInStackTrace());
        String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2003");
        writeOutputStream(true, "PL-BI-1004", entryName, message);
        return false;
    }
    return true;
}

From source file:com.fujitsu.dc.core.bar.BarFileReadRunner.java

/**
 * 00_$metadata_xml??????.//from  w ww . j  ava2s. co  m
 * @param entryName ??
 * @param inputStream 
 * @param davCmp Collection?
 * @return ????true
 */
protected boolean registUserSchema(String entryName, InputStream inputStream, DavCmpEsImpl davCmp) {
    EdmDataServices metadata = null;
    // XML(StAX,SAX,DOM)?InputStream???????????
    // ?????????????????
    try {
        InputStreamReader isr = new InputStreamReader(new CloseShieldInputStream(inputStream));
        // 00_$metadata.xml????
        XMLFactoryProvider2 provider = StaxXMLFactoryProvider2.getInstance();
        XMLInputFactory2 factory = provider.newXMLInputFactory2();
        XMLEventReader2 reader = factory.createXMLEventReader(isr);
        DcEdmxFormatParser parser = new DcEdmxFormatParser();
        metadata = parser.parseMetadata(reader);
    } catch (Exception ex) {
        log.info("XMLParseException: " + ex.getMessage(), ex.fillInStackTrace());
        String message = DcCoreMessageUtils.getMessage("PL-BI-2002");
        writeOutputStream(true, "PL-BI-1004", entryName, message);
        return false;
    } catch (StackOverflowError tw) {
        // ComplexType???StackOverFlowError??
        log.info("XMLParseException: " + tw.getMessage(), tw.fillInStackTrace());
        String message = DcCoreMessageUtils.getMessage("PL-BI-2002");
        writeOutputStream(true, "PL-BI-1004", entryName, message);
        return false;
    }
    // Entity/Property?
    // Property/ComplexProperty????ComplexType???????
    // ??ComplexType????EntityType?
    // DcODataProducer producer = davCmp.getODataProducer();
    try {
        createComplexTypes(metadata, davCmp);
        createEntityTypes(metadata, davCmp);
        createAssociations(metadata, davCmp);
    } catch (DcCoreException e) {
        writeOutputStream(true, "PL-BI-1004", entryName, e.getMessage());
        log.info("DcCoreException: " + e.getMessage());
        return false;
    } catch (Exception e) {
        log.info("Regist Entity Error: " + e.getMessage(), e.fillInStackTrace());
        String message = DcCoreMessageUtils.getMessage("PL-BI-2003");
        writeOutputStream(true, "PL-BI-1004", entryName, message);
        return false;
    }
    return true;
}