transmission of serialized objects over a POST http request with rhug - patch solution
Christophe Roux
ch_roux@club-internet.fr
Sat Sep 7 10:01:00 GMT 2002
I have 2 servlets communicating via a POST http request and trnasmitting a
serialized object.
It used to work fine with jdk and tomcat3.2.3.
I am on the road to gcj and rhug.
I found problems with the serialisation so that I build a small example with
two servlets which exchange a simple serialized object. This object contains
a Vector.
I had to change the code in gnu.gcj.protocol.http.Connection in order to have
a correct POST http request.
I send a gnats bug report with my solution to gcc but after one week, the bug
is still unasigned.
So I decided to give my correction to rhug users, allowing to patch gcj.
The Connection class is given in the tar joined to this mail.
After that, I found in rhug how to deserialise an object with the rhug class
loader, so that the MielMail object can be found by the receiving servlet
(M1.java). So I wrote a small class (MielObjectInputStream.java) for
deserialization class loading.
After that, there was a problem with deserialization of null objects in the
Vector of MielMail. I had to correct java.lang.ObjectInputStream.java because
there was a NullPointerException in a dump instruction.
In the joined tar file, I give all source files for these correction plus
exmaples classes.
I hope it can be usefull to rhug users and I also hope rhug gourous can point
out gcc developpers in order these bugs will be soon corrected in the gcc
release.
Yours sincerely,
Christophe Roux
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postobje.tgz
Type: application/x-gzip
Size: 13817 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/rhug-rhats/attachments/20020907/710f0f6a/attachment.bin>
More information about the Rhug-rhats
mailing list