Re: Deserialization InvalidClassException : no valid constructor

2013-05-27 Thread smallufo
I solve this problem by making the BufferedImage transient. 2013/5/27 Jonas > Well, you can't serialize the BufferedImage, but maybe you can serialize > whatever data you've used to render BufferedImage's contents, > i.e. instead of saving the image, save whatever is necessary to recreate > th

Re: Deserialization InvalidClassException : no valid constructor

2013-05-27 Thread Jonas
Well, you can't serialize the BufferedImage, but maybe you can serialize whatever data you've used to render BufferedImage's contents, i.e. instead of saving the image, save whatever is necessary to recreate the image? Or, you could store the BufferedImage's content to an actual image file (using I

Re: Deserialization InvalidClassException : no valid constructor

2013-05-21 Thread smallufo
Thanks. But in my example , I cannot modify BufferedImage (to add a no-arg constructor) What should I do if I want to output a BufferedImage (and make back button work) ? 2013/5/14 Jonas > This could only work if BufferedImage itself had a no-arg constructor. > It is it the first non-serializa

Re: Deserialization InvalidClassException : no valid constructor

2013-05-14 Thread Jonas
This could only work if BufferedImage itself had a no-arg constructor. It is it the first non-serializable class in the hierarchy that needs to have it, not the first serializable one, like in your example. Besides, you would still lose all data stored in the BufferedImage's fields (i.e. the image

Deserialization InvalidClassException : no valid constructor

2013-05-13 Thread smallufo
Today I encountered one famous deserialization problem : InvalidClassException : no valid constructor I googled and found some solution , but all are in-vain. The solution says the first non-serializable super class should define a no-arg constructor. But I try to define a no-arg constructor to E