Serge Savoie wrote:
> Ok, I have experiment a lot and found that :
> 
> When the Java Server use :
>     in = requestSocket.getInputStream();
> 
> It works... I can read what the Ruby socket is sending...
> 
> But the real Java server that I have to talk with use :
> 
>     in = new ObjectInputStream( new BufferedInputStream( 
> requestSocket.getInputStream() ) );
> 
> And in this case I get :
> 
> java.io.StreamCorruptedException: invalid stream header
>   at 
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:753)
>   at java.io.ObjectInputStream.<init>(ObjectInputStream.java:268)
>   at project1.SergeServer1.main(SergeServer1.java:44)
> 

The Java server is reading a Marshalled Java object, Usually that will only be used for two Java 
processes talking to each other.

If you are sending very simple Java Objects you could format it in Ruby and transmit it, but it 
would be messy. You will have to read the Sun documents on Java serialized object formats, look at 
the ObjectInputStream Javadoc for references to the required formats.

Try using JRuby instead and serialize the Java object in Java.



-- 
Jim Morris, http://blog.wolfman.com