Examples of initCause()


Examples of javax.jms.InvalidDestinationException.initCause()

                declareDestination(amqDestination);
            }
            catch(Exception e)
            {
                JMSException ex = new InvalidDestinationException("Error validating destination");
                ex.initCause(e);
                ex.setLinkedException(e);

                throw ex;
            }
            amqDestination.setExchangeExistsChecked(true);
View Full Code Here

Examples of javax.jms.InvalidSelectorException.initCause()

                        }
                        catch (AMQInvalidArgumentException ise)
                        {
                            JMSException jmse = new InvalidSelectorException(ise.getMessage());
                            jmse.setLinkedException(ise);
                            jmse.initCause(ise);
                            throw jmse;
                        }
                        catch (AMQInvalidRoutingKeyException e)
                        {
                            JMSException jmse = new InvalidDestinationException("Invalid routing key:" + amqd.getRoutingKey().toString());
View Full Code Here

Examples of javax.jms.JMSException.initCause()

      {
         // If a problem occurs during commit processing the session should be rolled back
         rollbackLocal(xid);
        
         JMSException e = new MessagingTransactionRolledBackException(t.getMessage());
         e.initCause(t);
         throw e;        
      }
   }
  
   public void rollbackLocal(Object xid) throws JMSException
View Full Code Here

Examples of javax.jms.JMSRuntimeException.initCause()

         producer.setDeliveryMode(deliveryMode);
      }
      catch (JMSException e)
      {
         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
         e2.initCause(e);
         throw e2;
      }
      return this;
   }
View Full Code Here

Examples of javax.jms.JMSSecurityRuntimeException.initCause()

         validateUser(conn);
      }
      catch (JMSSecurityException e)
      {
         JMSSecurityRuntimeException e2 = new JMSSecurityRuntimeException(e.getMessage());
         e2.initCause(e);
         throw e2;
      }
      catch (JMSException e)
      {
         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
View Full Code Here

Examples of javax.jms.MessageEOFException.initCause()

        if (msg == null || msg.length() == 0) {
            msg = cause.toString();
        }
        MessageEOFException exception = new MessageEOFException(msg);
        exception.setLinkedException(cause);
        exception.initCause(cause);
        return exception;
    }

    public static MessageFormatException createMessageFormatException(Exception cause) {
        String msg = cause.getMessage();
View Full Code Here

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

Examples of javax.management.JMException.initCause()

      jmxc = JMXConnectorFactory.connect(url, env);
  } catch (Exception e)  {
      JMException jme
    = new JMException("Caught exception when creating JMXConnector");
      jme.initCause(e);

      throw (jme);
  }

        return (jmxc);
View Full Code Here

Examples of javax.management.MBeanException.initCause()

        Assert.assertEquals(null, mbe.getMessage());
        Assert.assertEquals(null, mbe.getTargetException().getMessage());

        targetEx = new Exception("actual message");
        mbe = new MBeanException(targetEx);
        mbe.initCause(targetEx);
        Assert.assertEquals(targetEx, mbe.getCause());
        Assert.assertEquals(null, mbe.getMessage());

        mbe = toMBeanException(null, null);
        Assert.assertEquals(null, mbe.getMessage());
View Full Code Here

Examples of javax.management.MalformedObjectNameException.initCause()

            return (name);
        } catch (Exception e) {
            MalformedObjectNameException mone =
                new MalformedObjectNameException
                ("Cannot create object name for " + connector);
            mone.initCause(e);
            throw mone;
        }
    }

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.