Partially deserialized objects?

E

Eric Czarny

I am trying to send a serialized object from a JSP to another servlet
through HTTP, but I keep running into an invalid stream header
exception. My theory is that the servlet is (for some reason or
another) not reading the whole serialized object. I have tried placing
logging statements at different stages of the serialized object. If I
specify the Content-Length of the serialized object more logging
statements show up, but I still run into the invalid stream header
problem. Am I missing something critical? Has anybody else seen this
(or a similar) problem before?

Cheers,
Eric Czarny
 
E

Esmond Pitt

Eric said:
Has anybody else seen this
(or a similar) problem before?

This is usually caused by different lifetimes of the ObjectOutputStream
and ObjectInputStream on one side or the other when sending multiple
objects. You need to use one of each for the life of the connection, and
make sure you flush & close the OOS, not the stream it encloses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top