Package javax.jms

Examples of javax.jms.MessageFormatException


    try {
      clearBody();
      momMsg.setAdminMessage(adminMsg);
    } catch (Exception exc) {
      throw new MessageFormatException("Object serialization failed: " + exc);
    }
  }
View Full Code Here


      try {
        // If the message to send is a non proprietary JMS message, try
        // to convert it.
        joramMsg = Message.convertJMSMessage(msg);
      } catch (JMSException jE) {
        MessageFormatException mE = new MessageFormatException("Message to send is invalid.");
        mE.setLinkedException(jE);
        throw mE;
      }
    }
    //Add out interception...
    if ((outInterceptors != null) && (!outInterceptors.isEmpty())) {
View Full Code Here

    try {
      clearBody();
      momMsg.setObject(obj);
    } catch (Exception exc) {
      throw new MessageFormatException("Object serialization failed: " + exc);
    }
  }
View Full Code Here

    if (momMsg.body == null) return null;

    try {
      return momMsg.getObject();
    } catch (Exception exc) {
      throw new MessageFormatException("Error while deserializing the wrapped object: " + exc);
     }
  }
View Full Code Here

      else if (value instanceof Byte)
    outputStream.writeByte(((Byte) value).intValue());
      else if (value instanceof byte[])
        outputStream.write((byte[]) value);
      else
        throw new MessageFormatException("Can't write non Java primitive type"
                                         + " as a bytes array.");
    } catch (IOException ioE) {
      JMSException jE = new JMSException("Error while writing the value.");
      jE.setLinkedException(ioE);
      throw jE;
View Full Code Here

        outputStream.flush();
        momMsg.body = outputBuffer.toByteArray();
        prepared = true;
      }
    } catch (IOException exc) {
      MessageFormatException jExc =
        new MessageFormatException("The message body could not be serialized.");
      jExc.setLinkedException(exc);
      throw jExc;
    }
  }
View Full Code Here

         {
            dos.write((byte[]) value, 0, ((byte[]) value).length);
         }
         else
         {
            throw new MessageFormatException("Invalid object for properties");
         }
      }
      catch (IOException e)
      {
         throw new MessagingJMSException("IOException", e);
View Full Code Here

      else if (value instanceof String)
         ((Map)getPayload()).put(name, value);
      else if (value instanceof byte[])
         ((Map)getPayload()).put(name, ((byte[]) value).clone());
      else
         throw new MessageFormatException("Invalid object type.");

   }
View Full Code Here

      if (value instanceof Boolean)
         return ((Boolean) value).booleanValue();
      else if (value instanceof String)
         return Boolean.valueOf((String) value).booleanValue();
      else
         throw new MessageFormatException("Invalid conversion");
   }
View Full Code Here

      if (value instanceof Byte)
         return ((Byte) value).byteValue();
      else if (value instanceof String)
         return Byte.parseByte((String) value);
      else
         throw new MessageFormatException("Invalid conversion");
   }
View Full Code Here

TOP

Related Classes of javax.jms.MessageFormatException

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.