tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Merce Mulet <>
Subject Socket Exception
Date Thu, 21 Dec 2000 15:27:11 GMT
I've been using tomcat 3.1 on windows NT to serve an application where an 
applet and a servlet communicates using http-tunneling and object 
serialisation. The applet sends a command-object to the servlet using this 
few java  instructions:

connection = dataURL.openConnection();
connection.setUseCaches(false); //Specify the browser not cache to get 
fresh result
connection.setDoOutput(true); //tell the system to permit me to send data, 
not just read it
byteStream = new ByteArrayOutputStream(512);
out = new ObjectOutputStream(byteStream);
out.writeObject(command); //Write Post Data into local buffer
String lengthString =String.valueOf(byteStream.size());
connection.setRequestProperty("Content-Length", lengthString);
byteStream.writeTo(connection.getOutputStream()); //Write data to real 
output stream
/* read servlet answer */
ObjectInputStream in = new ObjectInputStream(connection.getInputStream());

This code works fine in my NT environment, but when I've migrated the whole 
on a Linux platform using tomcat 3.1 as well, I've got a problem with the 
servlet connection:

The applet gets an exception like next one, when executing the last 
instruction to get the servlet answer: Unexpected end of file from server

Has anyone any ideas?? Thanks.!!!

Merce Mulet Gascon
GTD. Ingenieria de sistemas y software industrial.
Rosa Sensat, 9-11. 08005. Barcelona.
t. (34)
f. (34)

View raw message