Given the code below -
I get ->
java.io.NotActiveException: not in call to writeObject
at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
at A.writeObject(A.java:36)
at A.writeExternal(A.java:47)
at java.io.ObjectOutputStream.writeExternalData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
Javadoc for defaultWriteObject says: This may only be called from the writeObject method of the class
being serialized. It will throw the NotActiveException if it is called otherwise.
May be, what i am doing is Illegal or may never be required but wanted to know the reason and whats going on behind the scene..
Also,This is my first post and hence don't know enough rules of forum, not sure should i post it here or somewhere else
Thanks