>>>>> On Tue, 13 Apr 99 08:55:48 EDT, Dennis Doubleday <[EMAIL PROTECTED]> said:

    Dennis> Tarang Patel <[EMAIL PROTECTED]> writes:

    >> >> To be more clear, I have an automated client program which issues >>
    >> several POSTs in succession.  Usually, the client and Apache+JServ work
    >> >> fine, but after a few hours of inactivity, the next batch of client
    >> >> requests will have at least 4 of those requests recieve HTTP 500
    >> errors >> from Apache.  The rest of the connections after that are fine
    >> - almost >> like Apache (or JServ) "warmed up".  >> ... snip
    >> 

    >> So the problem must be with Jserv. Aside this, it appears that Jserv
    >> freaks out if one packages the the servlets, and has the .jar file on
    >> the "repository" for the zone.  This being a separate problem
    >> altogether too.

    Dennis> It is possible that it is an Apache JServ problem, but it is far
    Dennis> more likely to be a problem in your code, because AJ is in use in
    Dennis> hundreds, if not thousands, of sites, while your code is used
    Dennis> at...your site.  It is quite natural to jump to the conclusion
    Dennis> that some underlying technology is the problem; I have to resist
    Dennis> the temptation all the time.

 I agree with you, so I have checked my servlet and used another servlet
 engine, "servletrunner" to execute the servlet. This works without any
 problems on both hosts - Solaris and Irix. I never jump to rash conclusions,
 and I'd rather find the fault in my code as it will save me making the same
 mistakes else where, alas as I can't reproduce this problem on different
 systems using the same .class file then I have to conclude a potential
 problem else where. Recall the days when one walked all over "pointers"
 and got memory corruption, well this is one of many symptoms one would
 more then likely see - surely not in Java.

    Dennis> Case in point (and very relevant to your problem), I just recently
    Dennis> tracked a very similar problem to our code: everything worked
    Dennis> fine, except that over night, when there was no activity,
    Dennis> something would go wrong and the next morning all requests would
    Dennis> be met with HTTP 500 errors. The AJP connection between Apache and
    Dennis> JServ seemed to have been lost because Apache was unable to kill
    Dennis> and restart JServ, even though automatic mode was in effect. At
    Dennis> first I thought it must be an AJP problem, that the connection was
    Dennis> lost after some period of inactivity.

    Dennis> The only thing happening during these periods of inactivity was
    Dennis> that a timer thread would periodically fire to check the
    Dennis> connections in the DB connection pool and recycle those that had
    Dennis> been inactive for some time, refreshing the pool with new
    Dennis> connections.

    Dennis> It turned out that the problem was that a FileInputStream object
    Dennis> was being created but not closed each time a new connection was
    Dennis> made. During normal activity this was obscured because enough
    Dennis> memory was being used up so that gc() was called before the open
    Dennis> file limit was being reached, and so the FileInputStream's
    Dennis> finalize() was called and the file was closed. When there was no
    Dennis> activity, no gc() happened, the open file limit was reached, and
    Dennis> the HTTP 500 errors started.

    Dennis> Maybe you have some similar background task running when the
    Dennis> server is otherwise inactive?

 Thanks for that tip, alas I do not have any background task running.

   Tarang


----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to