Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

GWT - DataObject was not serializable and has no concrete serializable subtypes

 
Greenhorn
Posts: 8
Mac OS X Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I've been working with GWT for a few weeks now, but now I have a big problem.

I'm using a DataObject to transport my objects from the database to the client.
So all my objects extend this DataObject.
This was working fine, until I tried to replace all the String-fields in the DataObject by a new class called 'DataAttribute'

This DataAttribute is nothing more than a class with 4 Strings ->
one representing the database-fieldname, one representing the 'readable' fieldname, one representing the value and one that can be used for a special display-value (used for foreign keys).

Now I can't start my webapp anymore, it gives this message for all my Objects;

[ERROR] Type 'weerribben.client.objects.DataAttribute' was not serializable and has no concrete serializable subtypes




The DataAttributes are stored in an ArrayList the DataObject-class, and are initialized in the implementing classes;


This is my DataAttribute;


And this is my DataObject (sorry for the dutch comments);


This is how I implement the intitalize-method;


Can anybody tell me what I'm doing wrong, or how I can find the problem??
 
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Online Metalhead", please check your private messages for an important administrative matter.
 
Dennis van Beek
Greenhorn
Posts: 8
Mac OS X Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I (finally) found the answer!

I forgot the default constructor in DataAttribute (which offcourse is needed for serialisation)!
(And I recently passed my SCJP, how could I forget?!?!)

More info; Blog with the answer
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!