Package javax.jms

Examples of javax.jms.JMSException


      {        
         return (JMSException)t;
      }
      else
      {
         JMSException e = new MessagingJMSException("A failure has occurred during processing of the request. " +
                                                    "Please consult the server logs for more details. " + msg + " [" + id + "]");   
         return e;
      }   
   }  
View Full Code Here


         }
      }

      if (jmsExceptionListenerCopy != null)
      {
         JMSException jmsException = null;

         if (throwable instanceof Error)
         {
            final String msg = "Caught Error on underlying remoting connection";
            log.error(this + ": " + msg, throwable);
            jmsException = new JMSException(msg + ": " + throwable.getMessage());
         }
         else if (throwable instanceof Exception)
         {
            Exception e = (Exception)throwable;
            jmsException = new JMSException("Failure on underlying remoting connection");
            jmsException.setLinkedException(e);
         }
         else
         {
            // Some other Throwable subclass
            final String msg = "Caught Throwable on underlying remoting connection";
            log.error(this + ": " + msg, throwable);
            jmsException = new JMSException(msg + ": " + throwable.getMessage());
         }

         jmsExceptionListenerCopy.onException(jmsException);
      }
   }
View Full Code Here

   }

   public void writeBytes(byte[] value, int offset, int length) throws JMSException
   {
      if (offset + length > value.length)
         throw new JMSException("Array is too small");
      byte[] temp = new byte[length];
      for (int i = 0; i < length; i++)
         temp[i] = value[i + offset];

      ((List)getPayload()).add(temp);
View Full Code Here

            return null;
         }
        
         if (listener != null)
         {
            throw new JMSException("The consumer has a MessageListener set, " +
               "cannot call receive(..)");
         }
                      
         receiverThread = Thread.currentThread();
              
View Full Code Here

   public void setJMSMessageID(String jmsMessageID) throws JMSException
   {
      if (jmsMessageID != null && !jmsMessageID.startsWith("ID:"))
      {
         throw new JMSException("JMSMessageID must start with ID:");
      }
      this.jmsMessageID = jmsMessageID;
   }
View Full Code Here

   public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException
   {
      if (correlationID == null || correlationID.length == 0)
      {
         throw new JMSException("Please specify a non-zero length byte[]");
      }
      headers.put(CORRELATIONIDBYTES_HEADER_NAME, correlationID);
     
      headers.remove(CORRELATIONID_HEADER_NAME);
   }
View Full Code Here

      if (name.regionMatches(false, 0, "JMSX", 0, 4) &&
         !name.equals("JMSXGroupID") &&
         !name.equals("JMSXGroupSeq") &&
         !name.equals("JMSXDeliveryCount"))
      {
         throw new JMSException("Can only set JMSXGroupId, JMSXGroupSeq, JMSXDeliveryCount");
      }          
   }
View Full Code Here

       * Subsribes, collects, checking any set filters. A messageComsumer must be created before calling this. If arg set to true, do a failsafe sub
       */
      public void subscribe(boolean failsafe) throws JMSException
      {
         if (consumer == null)
            throw new JMSException("No messageConsumer created");

         if (failsafe)
            connection.setExceptionListener(this);

         consumer.setMessageListener(this);
View Full Code Here

      }

      public Message createMessage(int nr) throws JMSException
      {
         if (session == null)
            throw new JMSException("Session not allowed to be null");

         Message msg = session.createMessage();
         msg.setStringProperty(property, String.valueOf(start + nr));
         return msg;
      }
View Full Code Here

                  if (i >= low && i < max)
                     res = true;
               }
               catch (NumberFormatException ex)
               {
                  throw new JMSException("Property " + property + " was not int: " + p);
               }
            }
         }
         counter++;
         int mod = counter % report;
View Full Code Here

TOP

Related Classes of javax.jms.JMSException

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.