JMS exception handling

Since JMS 2.0, many of the methods in the simplified API now prefer to throw types based on javax.jms.RuntimeException, which is an unchecked exception. If you have already existing code from the earlier Java EE specification and it is compatible with JMS 1.1, then they will continue to throw the checked exceptions derived from the base class javax.jms.JMSException. The following table is an overview of the possible JMS exception types:

JMS Exception

Description

IllegalStateRuntimeException

The JMS provider throws an illegal state exception if there is a call that would put the provider in an inconsistent state or is a prohibited operation.

JMSSecurityRuntimeException

The JMS provider throws this exception when it rejects the user name / password credential submitted by the JMS client in order to achieve a connection.

InvalidClientIDRuntimeException

The provider throws this exception when the client ID is rejected or unrecognized according to the configuration of the administrative objects.

InvalidSelectorRuntimeException

The provider throws this exception if it fails to parse and understand a message selector.

MessageEOFException

A checked exception that the JMS provider throws when a client attempts to read a StreamMessage beyond the end of its input stream.

MessageFormatRuntimeException

This exception is thrown by the provider when the client attempts to use a data type not support by the message.

MessageNotWritableRuntime -Exception

The client has attempted to write to a read-only message.

ResourceAllocationRuntime-Exception

The JMS provider cannot fulfill the request to create a topic subscription or temporary queue due to the lack of operating system or provider-specific resources.

TransactionInProgressRuntime-Exception

This is caused by a JMS client calling a Session.commit() or JMSContext.commit() when the session is already part of a distributed Java transaction.

TransactionRolledBackRuntime-Exception

This is caused by a JMS client calling a Session.commit() or JMSContext.commit() when the session has already been set to be rolled back.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.179.100