You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by "ANEESH .V.V" <an...@gmail.com> on 2014/06/05 13:47:35 UTC

Problem with serialization and deserialization

hi,

   I have a JTree. I want to serialize it using
sc.saveAsObjectFile("path"). I could save it in some location. The real
problem is that when I deserialize it back using sc.objectFile(), I am not
getting the jtree. Can anyone please help me on this......

Thanks

Re: Problem with serialization and deserialization

Posted by Stefan van Wouw <st...@gmail.com>.
Dear Aneesh,

Your particular use case of using Swing GUI components with Spark is a bit unclear to me. 

Assuming that you want Spark to operate on a tree object, you could use an implementation of the TreeModel ( http://docs.oracle.com/javase/8/docs/api/javax/swing/tree/DefaultTreeModel.html ) used internally by the JTree. This class is serialisable, whereas JTree is not. This might be one of the causes of your problems when trying to serialise JTree (educated guess).

---
Kind regards,

Stefan van Wouw

On 05 Jun 2014, at 13:47, ANEESH .V.V <an...@gmail.com> wrote:

> 
> hi,
> 
>    I have a JTree. I want to serialize it using sc.saveAsObjectFile("path"). I could save it in some location. The real problem is that when I deserialize it back using sc.objectFile(), I am not getting the jtree. Can anyone please help me on this......
> 
> Thanks