wood burning stoves
The moose likes Servlets and the fly likes Servlet/applet communication failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet/applet communication failure" Watch "Servlet/applet communication failure" New topic

Servlet/applet communication failure

Ken Siberz

Joined: Jul 25, 2001
Posts: 1
I am plagued by an intermittant failure of getInputStream after successfully opening a URL connection to a servlet.
My applet periodically opens a URL connection to a servlet to receive data. The servlet acquires the data and sends an array of strings to the applet in an ObjectOutputStream. After a number of successful responses from the servlet, the applet hangs on a "connection.getInputStream()" method call. Here is part of the code, which is executed each time the applet needs data:
URL dataURL = new URL(...);
URLConnection connection = dataURL.openConnection();
InputStream URLin = connection.getInputStream();
Here's where it eventually hangs -- after from 5 to 50 successful iterations. I am testing with JRun 3.0.
Thanks for any help!
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
if you use under jdk1.3 from servlet to applet must declare Contentlength=how many bytes

Senior software engineer
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
see http://s1.sun.com/Search/fortebugs?qt=content-length&col=obug&qp=&rf=0
I agree. Here's the link: http://aspose.com/file-tools
subject: Servlet/applet communication failure
It's not a secret anymore!