JMS Exceptions

All the exceptions in JMS are sub-classed from the exception javax.jms.JMSException. JMSException provide exception chaining so that they provide a reference to the parent exception that caused the current exception. They also provide provider-specific error messages and error codes.

The standard exceptions used in JMS are documented in the JavaDoc for JMS, which is available as a download from http://java.sun.com/products/jms/docs.html. The list below shows a few of the standard JMS exceptions and their purpose. Please refer to the documentation for an exhaustive list:

  • java.lang.IllegalStateException

    This is thrown whenever a method is invoked at an inappropriate time. An example for this is setting the client ID for a connection created using a connection factory with pre-configured client ID.

  • javax.jms.JMSSecurityException

    This is thrown at the point of creating connections on failure of client authentication.

  • javax.jms.InvalidClientIDException

    This is thrown if the client tries to assign an invalid client ID to a connection.

  • javax.jms.MessageNotReadableException

    This is thrown if a client tries to read a write-only message. Messages are covered in more detail in the next chapter.

  • javax.jms.MessageNotWritableException

    This is thrown at if a client tries to write a read-only message.



Professional JMS
Professional JMS
ISBN: 1861004931
EAN: 2147483647
Year: 2000
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net