Menu

#29 XmlRpcServlet is not serializable

open
nobody
None
5
2014-10-08
2012-08-24
fkal
No

XmlRpcServlet is not serializable, since it has a non-transient field ("server") which is not serializable.
I think the field "server" should be made transient, it will be re-set in the class' init method.

An attempted seriliaziation of a subclass of XmlRpcServlet, leads to the following exception (if its _init_ method was called _before_!):
java.io.NotSerializableException: redstone.xmlrpc.XmlRpcServer
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)

Discussion

  • fkal

    fkal - 2012-08-30
     
  • fkal

    fkal - 2012-08-30

    Added a patch file as proposal for the fix.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.