Examples of FaultException


Examples of org.apache.ode.bpel.common.FaultException

                String msg = __msgs.msgEvalException(from.toString(), e
                        .getMessage());
                if (__log.isDebugEnabled())
                    __log.debug(from + ": " + msg);
                if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
                throw new FaultException(
                        getOAsssign().getOwner().constants.qnSelectionFailure,
                        msg);
            }
            if (l.size() == 0) {
                String msg = __msgs.msgRValueNoNodesSelected(expr.toString());
                if (__log.isDebugEnabled())
                    __log.debug(from + ": " + msg);
                throw new FaultException(
                        getOAsssign().getOwner().constants.qnSelectionFailure,
                        msg);

            } else if (l.size() > 1) {
                String msg = __msgs.msgRValueMultipleNodesSelected(expr
                        .toString());
                if (__log.isDebugEnabled())
                    __log.debug(from + ": " + msg);
                throw new FaultException(
                        getOAsssign().getOwner().constants.qnSelectionFailure,
                        msg);
            }
            retVal = (Node) l.get(0);
        } else if (from instanceof OAssign.Literal) {
            Element literalRoot = ((OAssign.Literal) from).getXmlLiteral().getDocumentElement();
            assert literalRoot.getLocalName().equals("literal");
            // We'd like a single text node...

            literalRoot.normalize();
            retVal = literalRoot.getFirstChild();

            // Adjust for whitespace before an element.
            if (retVal != null && retVal.getNodeType() == Node.TEXT_NODE
                    && retVal.getTextContent().trim().length() == 0
                    && retVal.getNextSibling() != null) {
                retVal = retVal.getNextSibling();
            }

            if (retVal == null) {
                // Special case, no children --> empty TII
                retVal = literalRoot.getOwnerDocument().createTextNode("");
            } else if (retVal.getNodeType() == Node.ELEMENT_NODE) {
                // Make sure there is no more elements.
                Node x = retVal.getNextSibling();
                while (x != null) {
                    if (x.getNodeType() == Node.ELEMENT_NODE) {
                        String msg = __msgs.msgLiteralContainsMultipleEIIs();
                        if (__log.isDebugEnabled())
                            __log.debug(from + ": " + msg);
                        throw new FaultException(
                                getOAsssign().getOwner().constants.qnSelectionFailure,
                                msg);

                    }
                    x = x.getNextSibling();
                }
            } else if (retVal.getNodeType() == Node.TEXT_NODE) {
                // Make sure there are no elements following this text node.
                Node x = retVal.getNextSibling();
                while (x != null) {
                    if (x.getNodeType() == Node.ELEMENT_NODE) {
                        String msg = __msgs.msgLiteralContainsMixedContent();
                        if (__log.isDebugEnabled())
                            __log.debug(from + ": " + msg);
                        throw new FaultException(
                                getOAsssign().getOwner().constants.qnSelectionFailure,
                                msg);

                    }
                    x = x.getNextSibling();
                }

            }

            if (retVal == null) {
                String msg = __msgs.msgLiteralMustContainTIIorEII();
                if (__log.isDebugEnabled())
                    __log.debug(from + ": " + msg);
                throw new FaultException(
                        getOAsssign().getOwner().constants.qnSelectionFailure,
                        msg);
            }
        } else {
            String msg = __msgs
                    .msgInternalError("Unknown RVALUE type: " + from);
            if (__log.isErrorEnabled())
                __log.error(from + ": " + msg);
            throw new FaultException(
                    getOAsssign().getOwner().constants.qnSelectionFailure, msg);
        }

        // Now verify we got something.
        if (retVal == null) {
            String msg = __msgs.msgEmptyRValue();
            if (__log.isDebugEnabled())
                __log.debug(from + ": " + msg);
            throw new FaultException(
                    getOAsssign().getOwner().constants.qnSelectionFailure, msg);
        }

        // Now check that we got the right thing.
        switch (retVal.getNodeType()) {
            case Node.TEXT_NODE:
            case Node.ATTRIBUTE_NODE:
            case Node.ELEMENT_NODE:
            case Node.CDATA_SECTION_NODE:
                break;
            default:
                String msg = __msgs.msgInvalidRValue();
                if (__log.isDebugEnabled())
                    __log.debug(from + ": " + msg);

                throw new FaultException(
                        getOAsssign().getOwner().constants.qnSelectionFailure, msg);

        }

        return retVal;
View Full Code Here

Examples of org.apache.ode.bpel.common.FaultException

            } else {
                // This really should have been cought by the compiler.
                __log
                        .fatal("Message/Non-Message Assignment, should be caught by compiler:"
                                + ocopy);
                throw new FaultException(
                        ocopy.getOwner().constants.qnSelectionFailure,
                        "Message/Non-Message Assignment:  " + ocopy);
            }
        } else {
            // Conventional Assignment logic.
View Full Code Here

Examples of org.apache.ode.bpel.common.FaultException

                // like
                // a PI or a CDATA.
                String msg = __msgs.msgInvalidLValue();
                if (__log.isDebugEnabled())
                    __log.debug(lvaluePtr + ": " + msg);
                throw new FaultException(
                        getOAsssign().getOwner().constants.qnSelectionFailure, msg);
        }

        return lvalue;
    }
View Full Code Here

Examples of org.apache.ode.bpel.common.FaultException

        if (alias.location != null) {
            try {
                lValue = _expLangRuntimeRegistry.evaluateNode(alias.location, ectx);
            } catch (EvaluationException ec) {
                throw new FaultException(getOProcess().constants.qnSelectionFailure, alias.getDescription());
            }
        }

        if (lValue == null) {
            String errmsg = __msgs.msgPropertyAliasReturnedNullSet(alias.getDescription(), target);
            if (__log.isErrorEnabled()) {
                __log.error(errmsg);
            }
            throw new FaultException(getOProcess().constants.qnSelectionFailure, errmsg);
        }

        if (lValue.getNodeType() == Node.ELEMENT_NODE) {
            // This is a bit hokey, we concatenate all the children's values; we
            // really should be checking to make sure that we are only dealing
View Full Code Here

Examples of org.apache.servicemix.jbi.FaultException

                if (exchange instanceof InOnly) {
                    // Do not use the fault has it may contain streams
                    // So just transform it to a string and send an error
                    String fault = new SourceTransformer().contentToString(me.getFault());
                    done(me);
                    fail(exchange, new FaultException(fault, null, null));
                } else {
                    Fault fault = MessageUtil.copyFault(me);
                    MessageUtil.transferToFault(fault, exchange);
                    done(me);
                    sendSync(exchange);
View Full Code Here

Examples of org.apache.servicemix.jbi.FaultException

                if (exchange instanceof InOnly) {
                    // Do not use the fault has it may contain streams
                    // So just transform it to a string and send an error
                    String fault = new SourceTransformer().contentToString(me.getFault());
                    done(me);
                    fail(exchange, new FaultException(fault, null, null));
                } else {
                    Fault fault = MessageUtil.copyFault(me);
                    MessageUtil.transferToFault(fault, exchange);
                    done(me);
                    sendSync(exchange);
                }
            } else {
                throw new IllegalStateException("Exchange status is " + ExchangeStatus.ACTIVE
                        + " but has no correlation set");
            }
        // Faults must be sent back to the consumer
        } else {
            if (exchange instanceof InOnly) {
                // Do not use the fault has it may contain streams
                // So just transform it to a string and send an error
                String fault = new SourceTransformer().contentToString(tme.getFault());
                done(tme);
                fail(exchange, new FaultException(fault, null, null));
            } else {
                Fault fault = MessageUtil.copyFault(tme);
                MessageUtil.transferToFault(fault, exchange);
                done(tme);
                sendSync(exchange);
View Full Code Here

Examples of org.apache.servicemix.jbi.FaultException

                MessageExchange me = (MessageExchange) store.load(consumerId);
                if (me instanceof InOnly) {
                    // Do not use the fault has it may contain streams
                    // So just transform it to a string and send an error
                    String fault = new SourceTransformer().contentToString(exchange.getFault());
                    fail(me, new FaultException(fault, null, null));
                    done(exchange);
                } else {
                    store.store(exchange.getExchangeId(), exchange);
                    MessageUtil.transferFaultToFault(exchange, me);
                    send(me);
View Full Code Here

Examples of org.apache.servicemix.jbi.FaultException

            protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out)
                throws MessagingException {
                Fault f = exchange.createFault();
                f.setContent(new StringSource("<hello xmlns='myuri'>this is a fault</hello>"));
                f.setProperty(JBIMarshaler.SOAP_FAULT_REASON, "My reason");
                throw new FaultException(null, exchange, f);
            }
        };
        echo.setService(new QName("urn:test", "echo"));
        echo.setEndpoint("echo");
        container.activateComponent(echo, "echo");
View Full Code Here

Examples of org.apache.servicemix.jbi.FaultException

            protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out)
                throws MessagingException {
                Fault f = exchange.createFault();
                f.setContent(new StringSource("<hello xmlns='myuri'>this is a fault</hello>"));
                f.setProperty(JBIMarshaler.SOAP_FAULT_REASON, "My reason");
                throw new FaultException(null, exchange, f);
            }
        };
        echo.setService(new QName("urn:test", "echo"));
        echo.setEndpoint("echo");
        container.activateComponent(echo, "echo");
View Full Code Here

Examples of org.apache.servicemix.jbi.FaultException

                     * we can't do much here if the ErrorHandler implementation does
                     * not support capturing messages
                     */
                    fault.setContent(new DOMSource(result.getNode(), result.getSystemId()));
                }
                throw new FaultException("Failed to validate against schema: " + schema, exchange, fault);
            }
            else {
                // Retrieve the ouput of the validation
                // as it may have been changed by the validator
                out.setContent(new DOMSource(result.getNode(), result.getSystemId()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.