Hi,

I have a servlet running on jserv1.1 for apache that opens an url input
stream. The strange behaviour is that after sometime and some usage (between
5 and 30 requests) opening the input stream blocks for 3 minutes and ends up
with a FileNotFoundException throws by the
sun.net.www.protocol.http.HttpURLConnection class. Note below that I open
and close the connection for every request and that as local variable the
connection is not shared among threads.

I've investigated and there is no request on the network going out from the
machine. So I must conclude that the JVM of Jserv is blocked. It seems that
JVM cannot call the URL correctly after some time.

here my small piece of code blocking:

    String urlStr = getBillUrl(session);
    URL url;
    urlStr= urlStr.trim();
    try
    {
      log("creating url for "+urlStr,9);
      url = new URL(urlStr);
    }
    catch (MalformedURLException e)
    {
      log(e.toString(), 0);
      throw e;
    }
    log("opening input stream for "+url, 0);
    InputStream d;
    try
    {
      d = url.openStream(); //HERE BLOCKS FOR 3 MINUTES !!
    }
    catch (FileNotFoundException fnfe)
    {
      log("the transaction was not successful: "+fnfe, 0);
      throw fnfe;
    }
    BufferedReader in = new BufferedReader(new InputStreamReader(d));
    log ("reading from reader...", 0);
    String billRes = in.readLine();
    in.close(); d.close();


I also tried with the class URLConnection and HttpURLConnection (I get 504
Gateway time-out)
If you have some suggestion I would really appreciate. For the moment I'm
re-installing the software on another box with another version of jserv to
see if the problems comes again.

thanx,
ernesto

___________________________________________________________________________
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

Reply via email to