JMS: some objects are no longer serializable
JMS objects such as JMS Connections and JMS Sessions, which used to be serializable when using the IBM® MQ classes for JMS for IBM WebSphere® MQ 7.0.1, are no longer serializable when using IBM WebSphere MQ 7.1 or later.
When a Java application serializes an object, state information about that object is written to an output stream, such as a file. The contents of output stream can then be read at a later date, to reconstruct (or deserialize) the Java object so that it can be reused.
- JMSConnection
- JMSQueueConnection
- JMSTopicConnection
- JMSSession
- JMSQueueSession
- JMSTopicSession
There is an IBM MQ connection handle (hconn) associated with every JMSConnection, JMSQueueConnection, JMSTopicConnection, JMSSession, JMSQueueSession and JMSTopicSession object that is created by an application.
Serializing one of these objects would result in state information about those objects being written to an output stream. This included information about the connection handle to IBM MQ that was associated with the object.
- Serialize a JMSConnection, JMSQueueConnection, JMSTopicConnection, JMSSession, JMSQueueSession or JMSTopicSession object using the method:
writeObject(ObjectOutputStream)
- Deserialize a JMSConnection, JMSQueueConnection, JMSTopicConnection, JMSSession, JMSQueueSession or JMSTopicSession object using the method:
readObject(ObjectInputStream)