Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.XMLProcessingException


            // this process cannot execute with either of these two objects so
            // throw an exception if either one or both is missing
            if (request == null || response == null) {
                Locator locator = context.getCurrentLocator();
                XMLProcessingException xmlException =
                        new XMLProcessingException(
                                "Null request and response objects in context",
                                locator);
                fatalError(xmlException);
            }

            // Get valid a RequestDispatcher to dispatch to
            RequestDispatcher dispatcher = getRequestDispatcher(request);
            try {
                dispatcher.include(request, response);
            } catch (Exception e) {
                Locator locator = getPipelineContext().getCurrentLocator();
                XMLProcessingException xmlException =
                        new XMLProcessingException("Failed to include URI ",
                                                   locator, e);
                fatalError(xmlException);
            }
        }
    }
View Full Code Here


    public void startElement(
            String namespaceURI, String localName, String qName,
            Attributes atts) throws SAXException {

        if (setter != null) {
            error(new XMLProcessingException(
                    "Nested elements not allowed inside simple elements, " +
                    "found " + qName + " inside " + currentQName,
                    getPipelineContext().getCurrentLocator()));
        }
View Full Code Here

            // the default namespace.
            if (namespaceURI.equals("")) {
                setter = setterFinder.findElementSetter(
                        defaultNamespace, localName);
                if (setter == null) {
                    error(new XMLProcessingException("Invalid element '" +
                            "{" + namespaceURI + "}" + localName + "'",
                            getPipelineContext().getCurrentLocator()));
                } else {
                    foundUnqualifiedElementThatMatched = true;
                }
View Full Code Here

    private void handleException(Exception e,String absoluteURI)throws SAXException {
        StringBuffer errorMessages = this.getCollatingErrorListener().getErrorBuffer();
        this.getCollatingErrorListener().resetErrorBuffer();
        Locator locator = getPipelineContext().getCurrentLocator();
        SAXParseException error =
                new XMLProcessingException("Error while attempting to process: "+
                        absoluteURI + "\ndue to following errors: "+
                        errorMessages,locator, e);
        fatalError(error);

    }
View Full Code Here

        }

        if (!transFactory.getFeature(SAXSource.FEATURE)) {
            Locator locator = getPipelineContext().getCurrentLocator();
            String message = "Unable to obtain a SAXTransformerFactory";
            fatalError(new XMLProcessingException(message, locator));
        }
        return (SAXTransformerFactory) transFactory;
    }
View Full Code Here

    // javadoc inherited
    public void startProcess() throws SAXException {
        super.startProcess();

        if (serverURL == null) {
            fatalError(new XMLProcessingException(
                    "A server URL must be specified",
                    getPipelineContext().getCurrentLocator()));
        } else {
            try {
                // Validate the server URL
                new URL(serverURL);
            } catch (MalformedURLException e) {
                fatalError(new XMLProcessingException(
                        "The server URL must be a well-formed URL",
                        getPipelineContext().getCurrentLocator(),
                        e));
            }
        }
View Full Code Here

        if (null != parse &&
                !(XML_VALUE.equals(parse) || TEXT_VALUE.equals(parse))) {
            // need to send an error down the pipeline
            Locator locator = context.getCurrentLocator();
            XMLProcessingException e =
                    new XMLProcessingException("parse attribute must either " +
                                               TEXT_VALUE + " or " + XML_VALUE,
                                               locator);
            isValid = false;
            target.fatalError(e);
        }
View Full Code Here

            Locator currentLocator =
                    context.getCurrentLocator();

            // this is a processing error as it will occur before we start
            // reading in the text
            XMLProcessingException se =
                    new XMLProcessingException(
                            "Inclusion failed due to " +
                            "unsupporteddocument character encoding " +
                            characterEncoding, currentLocator, uee);

            uridFetchTransaction.stop(
View Full Code Here

                method.invoke(derivableHTTPMessageEntity, arguments);

            } catch (NoSuchMethodException e) {
                e.printStackTrace();
                logger.error("unexpected-no-such-method-exception", e);
                error(new XMLProcessingException(
                            exceptionLocalizer.format(
                                        "unexpected-no-such-method-exception"),
                            getPipelineContext().getCurrentLocator(),
                            e));
            } catch (SecurityException e) {
                e.printStackTrace();
                logger.error("unexpected-security-exception", e);
                error(new XMLProcessingException(
                            exceptionLocalizer.format(
                                        "unexpected-security-exception"),
                            getPipelineContext().getCurrentLocator(),
                            e));
            } catch (IllegalAccessException e) {
                e.printStackTrace();
                logger.error("unexpected-illegal-access-exception", e);
                error(new XMLProcessingException(
                            exceptionLocalizer.format(
                                        "unexpected-illegal-access-exception"),
                            getPipelineContext().getCurrentLocator(),
                            e));
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
                logger.error("unexpected-exception", e);
                error(new XMLProcessingException(
                            exceptionLocalizer.format("unexpected-excpetion"),
                            getPipelineContext().getCurrentLocator(),
                            e));
            } catch (InvocationTargetException e) {
                e.printStackTrace();
                logger.error("unexpected-invocation-target-exception", e);
                error(new XMLProcessingException(
                            exceptionLocalizer.format(
                                        "unexpected-invocation-target-exception"),
                            getPipelineContext().getCurrentLocator(),
                            e));
            } finally {
                // Reset the chars array.
                chars = null;
            }
        } else {
            final String message = "localName, characters and message entity " +
                    "should not be null. Values are: localName='" + localName +
                    "', chars='" + chars + "', derivableMessageEntity='" +
                    derivableHTTPMessageEntity + "'";
            if (logger.isDebugEnabled()) {
                logger.debug(message);
            }

            error(new XMLProcessingException(
                    message, getPipelineContext().getCurrentLocator()));
        }
    }
View Full Code Here

        if (PARAMETERS_ELEMENT.equals(localName) &&
                namespaceURI.equals(adapterProcess.getProcessNamespaceURI())) {
            // Check that no templates have been added yet.  The parameters
            // element must be the first child of the transform element.
            if (operationProcess.getTemplateCount() > 0) {
                XMLProcessingException xpe = new XMLProcessingException(
                        "The parameters element must be the first child of " +
                        "the transform element.", adapterProcess.
                                                  getPipelineContext().getCurrentLocator());
                // report the error down the pipeline.
                fatalError(xpe);
            }
            adapterProcess.changeState(new Parameters(adapterProcess),
                                       namespaceURI, localName, qName, atts);
        } else if (TRANSFORMATION_ELEMENT.equals(localName) &&
                namespaceURI.equals(adapterProcess.getProcessNamespaceURI())) {

            // ok we have a transformation element directly inside a
            // transform element. We must ensure that no other
            // transformation has been requested (if so a transformations
            // element should have been the parent.
            if (operationProcess.getTemplateCount() > 0) {
                XMLProcessingException xpe = new XMLProcessingException(
                        "Transform elements can at most contain one " +
                        "transformation element", adapterProcess.
                                                  getPipelineContext().getCurrentLocator());
                // report the error down the pipeline.
                fatalError(xpe);
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.XMLProcessingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.