Package javax.jms

Examples of javax.jms.MessageFormatException.initCause()


                    Serializable payload = context.getTypeConverter().mandatoryConvertTo(Serializable.class, exchange, body);
                    message.setObject(payload);
                } catch (NoTypeConversionAvailableException e) {
                    // cannot convert to serializable then thrown an exception to avoid sending a null message
                    JMSException cause = new MessageFormatException(e.getMessage());
                    cause.initCause(e);
                    throw cause;
                }
            }
            return message;
        default:
View Full Code Here


                    Serializable payload = context.getTypeConverter().mandatoryConvertTo(Serializable.class, exchange, body);
                    message.setObject(payload);
                } catch (NoTypeConversionAvailableException e) {
                    // cannot convert to serializable then thrown an exception to avoid sending a null message
                    JMSException cause = new MessageFormatException(e.getMessage());
                    cause.initCause(e);
                    throw cause;
                }
            }
            return message;
        default:
View Full Code Here

        if (msg == null || msg.length() == 0) {
            msg = cause.toString();
        }
        MessageFormatException exception = new MessageFormatException(msg);
        exception.setLinkedException(cause);
        exception.initCause(cause);
        return exception;
    }
}
View Full Code Here

        }
        catch (IOException e)
        {
            MessageFormatException mfe = new MessageFormatException("Message not serializable: " + e);
            mfe.setLinkedException(e);
            mfe.initCause(e);
            throw mfe;
        }

    }
View Full Code Here

        }
        catch (IOException e)
        {
            MessageFormatException mfe = new MessageFormatException("Could not deserialize message: " + e);
            mfe.setLinkedException(e);
            mfe.initCause(e);
            throw mfe;
        }
        catch (ClassNotFoundException e)
        {
            MessageFormatException mfe = new MessageFormatException("Could not deserialize message: " + e);
View Full Code Here

        }
        catch (ClassNotFoundException e)
        {
            MessageFormatException mfe = new MessageFormatException("Could not deserialize message: " + e);
            mfe.setLinkedException(e);
            mfe.initCause(e);
            throw mfe;
        }
        finally
        {
          //  _data.rewind();
View Full Code Here

                try {
                    payload = context.getTypeConverter().mandatoryConvertTo(Serializable.class, exchange, body);
                } catch (NoTypeConversionAvailableException e) {
                    // cannot convert to serializable then thrown an exception to avoid sending a null message
                    JMSException cause = new MessageFormatException(e.getMessage());
                    cause.initCause(e);
                    throw cause;
                }
                return session.createObjectMessage(payload);
            default:
                break;
View Full Code Here

        }
        catch (AMQPInvalidClassException aice)
        {
            MessageFormatException mfe = new MessageFormatException(AMQPInvalidClassException.INVALID_OBJECT_MSG + (object == null ? "null" : object.getClass()));
            mfe.setLinkedException(aice);
            mfe.initCause(aice);
            throw mfe;
        }
    }

    public boolean itemExists(String string) throws JMSException
View Full Code Here

            try {
                payload = context.getTypeConverter().mandatoryConvertTo(Serializable.class, exchange, body);
            } catch (NoTypeConversionAvailableException e) {
                // cannot convert to serializable then thrown an exception to avoid sending a null message
                JMSException cause = new MessageFormatException(e.getMessage());
                cause.initCause(e);
                throw cause;
            }
            return session.createObjectMessage(payload);
        default:
            break;
View Full Code Here

        String msg = cause.getMessage();
        if( msg==null || msg.length()==0 )
            msg = cause.toString();
        MessageFormatException exception = new MessageFormatException(msg);
        exception.setLinkedException(cause);
        exception.initCause(cause);
        return exception;
    }
}
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.