• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Weird Serialization Problem

 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys,

I'm messing around with Serialization a little and came across a problem with the following piece of test code.


This is where it blows off with a NotSerializableException --> oos.writeObject(new GIO());

The interface GenericInventoryObserver<Film> extends from Serializable so I don't really get the problem here.

Thanks for help.
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably due to the fact that GIO's outer class itself doesn't implement java.io.Serializable either directly or indirectly.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jelle Klap wrote:Probably due to the fact that GIO's outer class itself doesn't implement java.io.Serializable either directly or indirectly.



Good catch. Didn't even noticed that the class was defined as private.

Henry
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:

Jelle Klap wrote:Probably due to the fact that GIO's outer class itself doesn't implement java.io.Serializable either directly or indirectly.



Good catch. Didn't even noticed that the class was defined as private.

Henry



And that is exactly what the problem was :-)
 
reply
    Bookmark Topic Watch Topic
  • New Topic