I have an applet that communicates with a GenericServlet via a serialized
object with code like this:
Foo protocolObject = new Foo();
URL mURL = new URL("http", "servletHost", 80,
"/servlet/FooServlet");
URLConnection mURLConnection;
if ((mURLConnection = mURL.openConnection()) != null)
{
// we'll be writing
mURLConnection.setDoOutput(true);
// and reading
mURLConnection.setDoInput(true);
// don't use any caching
mURLConnection.setUseCaches(false);
// no keep-alive
mURLConnection.setRequestProperty("Connection", "close");
// binary data
mURLConnection.setRequestProperty("Content-Type",
"application/octet-stream");
// get its output connection
ObjectOutputStream mOOStream = new
ObjectOutputStream(mURLConnection.getOutputStream());
// communicate a Foo to the servlet
mOOStream.writeObject(protocolObject);
mOOStream.flush();
mOOStream.close();
// get response back in the form of another Foo
ObjectInputStream mOIStream =
new ObjectInputStream(mURLConnection.getInputStream());
Foo response = ((Foo) mOIStream.readObject());
mOIStream.close();
}
So this code works swimmingly with ServletExec, JavaWebServer, WebSphere,
and JRun 2.2, but with JRun 2.3, there's a
java.io.StreamCorruptedException ("Caught EOFException while reading the
stream header")
thrown on the readObject(). I see the same exception being logged by the
servlet when it's reading the object the applet writes in the code above.
Has anyone seen anything like this, or have any suggestions on how I could
make JRun 2.3 happy? Thanks in advance for any and all pointers.
---
Jim Tomlinson [EMAIL PROTECTED] 206.217.7927
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html