RestComm / jain-slee.diameter

JAIN SLEE jDiameter Resource Adaptors Repository
http://www.restcomm.com/
GNU Affero General Public License v3.0
11 stars 33 forks source link

NonSerializableException for diameter-mobicents-slee-ra-diameter-rf-ra #29

Closed ammendonca closed 7 years ago

ammendonca commented 7 years ago

When deployed in cluster, Diameter-Rf-Ra throws NonSerializableException, when jboss tries to replicate state of Rf-Ra.

java.io.NotSerializableException: org.mobicents.slee.resource.diameter.rf.RfMessageFactoryImpl 
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) 
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) 
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)

The cause of this behaviour is that RfClientSessionActivityImpl extends RfSessionActivityImpl which has declaration:

protected RfMessageFactory rfMessageFactory;

RfMessageFactory is not serializable.

Solution Declare rfMessageFactory field as transient in RfSessionActivityImpl.

(From Zendesk Issue 34342)