[Spread-users] deserialization problem on unix?

Rod Fleischer rodf at sparta.com
Wed May 14 17:49:54 EDT 2003


Daniel Rall wrote:


> Right, but it's easy to have the definitions of the class differ between
> hosts, so that the bytecodes on one side of the network connection are
> slightly different than the bytecodes on the other side.  Since 
> you mounted the same file system for use by both hosts, this seems unlikely 
> (especially since you even diffed the serialized data).


Agreed.  This is one of the reasons that I'm doing it via smbmount. 
(The other being that I don't have to copy object code across after a 
recompile.)


> I'd try upping the XP version to _02 (assuming it's available).  I'd also 

done.  no difference.

> For a narrower test case, I suggest open a TCP socket connection between 
> your Linux and XP hosts, and writing a serialized 
> com.sparta.network.spread.Foo object across it.  If you can deserialize on 
> the Linux side, there may be a problem in that internal_receive() method of  
> the SpreadConnection class.  If you still can't deserialize, the problem is 
> somewhere in the JVM, library, envrionment, or OS level.


Tried this.  Will include source below.  Without spread, it worked just 
fine.  Linux side deserialized without any problem.  This suggests to me 
that the problem is in fact in spread somewhere.  I don't understand why 
there's a problem with the same serialized data on both sides, but with 
spread removed from the picture it works...

Any idea what the likelihood of a fix in the near future would be?

If I can provide any further analysis, please let me know.

-Rod


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rod Fleischer          Senior Engineer          SPARTA, Inc.
410.872.1515.x241      410.872.8079 (fax)       rodf at sparta.com


-----------------------------------
---------------------Moonblade.java
-----------------------------------
/*
  * Moonblade.java
  *
  * Created on May 14, 2003, 3:27 PM
  */

package com.sparta.network.spread;

import java.io.*;
import java.net.*;

/**
  *
  * @author  rodf
  */
public class Moonblade {

     /** Creates a new instance of Moonblade */
     public Moonblade() {
     }

     /**
      * @param args the command line arguments
      */
     public static void main(String[] args) {
         try
         {

             Foo foo = new Foo( "Hi Charlie!" );

             Socket sock = new Socket( "charlie", 4321 );
             ObjectOutputStream oos = new ObjectOutputStream(
					sock.getOutputStream() );
             oos.writeObject( foo );
             oos.flush();
             oos.close();
             sock.close();

             System.out.println( "Sent:  " + (String) foo.getData() );
         }
         catch ( Exception e )
         {
             e.printStackTrace();
         }
     }

}


-----------------------------------
-----------------------Charlie.java
-----------------------------------
/*
  * Charlie.java
  *
  * Created on May 14, 2003, 3:27 PM
  */

package com.sparta.network.spread;

import java.io.*;
import java.net.*;

/**
  *
  * @author  rodf
  */
public class Charlie implements Serializable {

     /** Creates a new instance of Charlie */
     public Charlie() {
     }

     /**
      * @param args the command line arguments
      */
     public static void main(String[] args) {

         try
         {
             ServerSocket ss = new ServerSocket( 4321 );
             Socket sock = ss.accept();

             ObjectInputStream ois = new ObjectInputStream(
					sock.getInputStream() );
             Foo foo = (Foo) ois.readObject();

             System.out.println( "Received:  " + (String) foo.getData() 
);
         }
         catch ( Exception e )
         {
             e.printStackTrace();
         }
     }

}






More information about the Spread-users mailing list