Package javax.jbi.messaging

Examples of javax.jbi.messaging.MessagingException


                        fault.setContent(
                                sourceTransformer.toDOMSource(
                                        new StringSource(
                                                (String)errorHandler.getMessagesAs(String.class))));
                    } else {
                        throw new MessagingException("MessageAwareErrorHandler implementation " +
                                errorHandler.getClass().getName() +
                                " does not support a compatible error message format.");
                    }
                } else {
                    /*
                     * 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()));
                return true;
             }
        }
        catch (SAXException e) {
            throw new MessagingException(e);
        }
        catch (IOException e) {
            throw new MessagingException(e);
        }
        catch (ParserConfigurationException e) {
            throw new MessagingException(e);
        }
        catch (TransformerException e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here


                Element elem;
                try {
                    elem = transformer.toDOMElement(in.getContent());
                    log.info(transformer.toString(elem));
                } catch (Exception e) {
                    throw new MessagingException(e);
                }
                assertEquals(JbiConstants.WSDL11_WRAPPER_MESSAGE, DomUtil.getQName(elem));
                out.setContent(
                         new StringSource("<jbi:message xmlns:jbi='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
                                   + "<jbi:part><HelloResponse xmlns='uri:HelloWorld'>world</HelloResponse></jbi:part>"
View Full Code Here

                Element elem;
                try {
                    elem = transformer.toDOMElement(in.getContent());
                    log.info(transformer.toString(elem));
                } catch (Exception e) {
                    throw new MessagingException(e);
                }
                assertEquals(new QName("uri:HelloWorld", "HelloRequest"), DomUtil.getQName(elem));
                out.setContent(new StringSource("<HelloResponse xmlns='uri:HelloWorld'>world</HelloResponse>"));
                return true;
            }
View Full Code Here

            DOMUtil.addChildElement(root, "fullname", detail.getFullName());
            DOMUtil.addChildElement(root, "description", detail.getDescription());
            DOMUtil.addChildElement(root, "fireTime", context.getFireTime());
            message.setContent(new DOMSource(document));
        } catch (ParserConfigurationException e) {
            throw new MessagingException("Failed to create content: " + e, e);
        }
    }
View Full Code Here

                + (Math.ceil(1000 * Math.random()) / 100) + "</rate></getLoanQuoteResponse>";
            NormalizedMessage answer = inOut.createMessage();
            answer.setContent(new StringSource(output));
            answer(inOut, answer);
        } catch (Exception e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here

                NormalizedMessage answer = inOut.createMessage();
                answer.setContent(new StringSource(output));
                answer(inOut, answer);
            }
        } catch (Exception e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here

            // use the marshaler to get the query embedded in the "in" message
            String query = null;
            try {
                query = this.fromMessageToQuery(message);
            } catch (TransformerException te) {
                throw new MessagingException("Error while parsing incoming message.", te);
            }
            // execute the query on the database and get result set
            String result = (String)jdbcTemplate.queryForObject(query, String.class);
            // send content in out message (depending of the MEP)
            message.setContent(new StringSource("<result>" + result + "</result>"));
View Full Code Here

        }
    }

    protected void checkNotClosed() throws MessagingException {
        if (closed.get()) {
            throw new MessagingException(this + " has been closed.");
        }
    }
View Full Code Here

                    }
                }
            }
            return me;
        } catch (InterruptedException e) {
            throw new MessagingException("accept failed", e);
        }
    }
View Full Code Here

                        throw new IllegalStateException(
                                        "the transaction context set in the messageExchange is not bound to the current thread");
                    }
                }
            } catch (Exception e) {
                throw new MessagingException(e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.jbi.messaging.MessagingException

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.