XML Feeds

.

[java-dev] Re: Re: find a non-serializable class/object

jbmaxwell jbmaxwell at rubato-music.com
Wed Jan 9 13:10:42 MST 2008


Cheers, Owen.

Yes, I'm using Eclipse already. I'll look for a generic Object. I'm not sure where that would be, but I do have some vague recollection that I might have used an ArrayList<Object> to handle some subclassed objects... Not sure. Maybe that's where it's choking. I'll look into it.

I read somewhere that serialization is not great for persistence. But that's about all I've been using, so far. Any particular approaches I should read up on? What do you tend to use?

thanks again.

J.


Quote: owen wrote on Wed, 09 January 2008 19:48
----------------------------------------------------
> 
>  > java.io.NotSerializableException: java.lang.Object
> 
> Suggests that it's choking on trying to serialize an instance of 
> java.lang.Object. This seems unlikely, but it's possible that a class 
> somewhere in your object graph has a field declared as Object.
> 
> This could include built-in classes (like implementations of Reference, 
> for example). If you can find it, you could either skip serializing it, 
> by also declaring it transient, or work out way of serializing the thing.
> 
> Eclipse, or similar, should make it much easier to find the culprit, if 
> you're not already using it.
> 
> -- 
> O
> 
> jbmaxwell wrote:
> > No. All it shows in the trace, before it hits my "save" method is:
> > 
> > java.io.NotSerializableException: java.lang.Object
> > 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
> > 	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
> > 	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
> > 	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
> > 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> > 	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
> > 
> > ...which doesn't do me much good.
> > 
> > J.
> > 
> > 
> > 
> 
> 
----------------------------------------------------




More information about the java-dev mailing list