Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

keep getting InvalidClassException 1

Status
Not open for further replies.

frag

Programmer
Dec 7, 2000
321
0
0
GB
Hi!

I am trying to read a some kind of complex serialized object from a stream. Here is the object's class:

Code:
public class ReloadScheduleObj implements Serializable
{
  // *** object related varibles ***
  private String strSubimportKey;
  private String strSource;
  private String strCalculateAggs;
  private ReloadScheduleTableModel tmReloadSchedule;
  // *** gerneral varibles ***
  private int iReturnCode;
  private int a,x = 0;

 public ReloadScheduleObj()
 {
 	strSubimportKey = "";
 	strSource = "";
 	strCalculateAggs = "0";
 	tmReloadSchedule = null;
 	iReturnCode = -1;
 }


 // *** set and get methodes for object related variables ***
 public void setSubimportKey(String value){ strSubimportKey = value; }
 public String getSubimportKey(){ return strSubimportKey; }
 public void setSource(String value){ strSource = value; }
 public String getSource(){ return strSource; }
 public void setCalculateAggs(String value){ strCalculateAggs = value; }
 public String getCalculateAggs(){ return strCalculateAggs; }
 public void setReloadScheduleTableModel(ReloadScheduleTableModel value){ tmReloadSchedule = value; }
 public ReloadScheduleTableModel getReloadScheduleTableModel(){ return tmReloadSchedule; }
 public ReloadScheduleTableModel updateTableModel(ReloadScheduleTableModel tm){ }
 // *** set and get methodes for general variables ***
 public void setReturnCode(int value){ iReturnCode = value; }
 public int getReturnCode(){ return iReturnCode; }

}

While trying to read the object from the stream I get an InvalidClassException whenever I used the setReloadScheduleTableModel() methode before writing the object to the stream. The ReloadScheduleTableModel is a class that extends the DefaultTableModel. If I don't set the model at all then I can read the object. I can even read the object if I did something like setReloadScheduleTableModel(new ReloadScheduleTableModel()) but as soon as I set a object of ReloadScheduleTableModel that has been manipulated in any way before I will get the exception.

Here ist the exception:
Code:
java.io.InvalidClassException: javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = -5353880800724033550, local class serialVersionUID = 5896976265092562486

We are talking about a client-server-application and I already tried to compile everything on the server-side and copy the class-files to the client but this didn't work. This was a tip I read in the SUN-forum.

I hope I explained my problem in a understandable way...

As always... any help is welcome.

Cheers

frag

patrick.metz@epost.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top