Applet fails to load Serialized Object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Patrick_Goovaerts
Posted On:   Tuesday, April 17, 2001 10:20 AM

I need to send data from a Servlet to an Applet. Therefore I created an Serialized object which contains all data I need. Loading the Applet fails and the problem seems to be the serialize object itself. Can anyone tell me what is wrong ? Here is the code I use for the serialized object: package com.clipper.objects; import com.clipper.model.*; import com.clipper.objects.*; import java.util.*; import java.io.*; /** * Insert the type's description here. * Creation date: (9/04/2001 15:47:43) * @author: */ public class TimeSheetScreenData implements Serializable { public String screenerror = new String(); public TimeSheetHeader aTsh = new TimeSheetHeader   More>>

I need to send data from a Servlet to an Applet. Therefore I created an Serialized object which contains all data I need. Loading the Applet fails and the problem seems to be the serialize object itself. Can anyone tell me what is wrong ? Here is the code I use for the serialized object:

			
package com.clipper.objects;
import com.clipper.model.*;
import com.clipper.objects.*;
import java.util.*;
import java.io.*;
/**
* Insert the type's description here.
* Creation date: (9/04/2001 15:47:43)
* @author:
*/
public class TimeSheetScreenData implements Serializable {
public String screenerror = new String();
public TimeSheetHeader aTsh = new TimeSheetHeader();
public Vector vTsd = new Vector(40,10);
public String executeAction = new String();
public com.clipper.model.File aFile = new
com.clipper.model.File);
/**
* CheckScreen constructor comment.
*/
public TimeSheetScreenData() {
super();
}
}
   <<Less

Re: Applet fails to load Serialized Object

Posted By:   Tim_Rohaly  
Posted On:   Friday, April 20, 2001 08:32 PM

You don't say what the error is, so I'm going to guess.
In order for an instance of TimeSheetScreenData
to be serializable, all non-transient objects reachable from
that instance must also be serializable. In particular, in
your above example, com.clipper.model.File must
be serializable (including all objects reachable from it),
and every object stored in your Vector must also
be serializable. If any one of those objects is not serializable,
the serialization will fail. This has nothing to do with the
fact that an Applet or a Servlet is involved.
About | Sitemap | Contact