Rishi,

Actually, you can catch Errors. Error is a subclass of Throwable. Catching
them just isn't  recommended, and normally isn't useful or necessary. From
the JavaDocs:

An Error is a subclass of Throwable that indicates serious problems that a
reasonable application should not try to catch.
Most such errors are abnormal conditions. The ThreadDeath error, though a
"normal" condition, is also a subclass of Error
because most applications should not try to catch it.

I have actually caught an Error inside a servlet before, though, because
the servlet runner wasn't providing any information other than the
name of the error (no stack trace). The error was being thrown during file
I/O in my init method, and I was only able ot figure that out
by catching the error and writing out the stack trace.

Kito D. Mann
[EMAIL PROTECTED]




[EMAIL PROTECTED]
Wednesday December 29, 1999 11:45 AM

Please respond to [EMAIL PROTECTED]
To:   [EMAIL PROTECTED]
cc:    (bcc: Kito Mann/PSG/Prudential)
Subject:  Re: OutOfMemoryError - Addendum




..refer to my previous mail for the out of memory ans.
Also .... you can only catch exceptions ..... never an error . ....
So there is nothing much that you do about errors once they happen ... i
guess
!!!!
Rishi.

Sigurpall Johannsson wrote:

> Hi all
>
> Can anybody help me with this one:
> My servlets crash 1-2 times each 24 hours.
> When I check out my error log file this is the output:
> java.lang.OutOfMemoryError
>         at org.apache.jserv.JServConnection.processRequest(Compiled
Code)
>         at org.apache.jserv.JServConnection.run(Compiled Code)
>         at java.lang.Thread.run(Compiled Code)
>
> Also can anybody guide me where to catch this error.
>
> I am using Apache/1.3.9 with ApacheJServ/1.1b2 on Linux(Red Hat)
> I am using  jsdk2.0 and DBConnection from JavaExchange
>
> best regards
>
> Sigurpall Johannsson
> Sotware engineer
> www.BePaid.Com
> Tel: (+354)5888112
> Fax: (+354)8617539
> Mobile: (+354)8617539
> [EMAIL PROTECTED]
>
>
___________________________________________________________________________

> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".

rishi.vcf

Reply via email to