Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > redirecting errors

Reply
Thread Tools

redirecting errors

 
 
bitshit
Guest
Posts: n/a
 
      08-17-2005
Hi,

Is it possible to redirect java errors to post to a url? I have a generic
library that some third party classes extend. When these third party classes
generate errors/crash i'd like to post these errors to a script instead of
the jvm printing it standard to the console... it concerns applets, the
third party applets extend a super class form my library where I migth be
able to set such a redirect?

Thanks!


 
Reply With Quote
 
 
 
 
jan V
Guest
Posts: n/a
 
      08-17-2005
> Is it possible to redirect java errors to post to a url?

Check out System.setErr(PrintStream) and System.setOut(PrintStream), taking
particular note that both methods are SecurityManager-restricted (I'm
assuming this can be solved by signing the applets). If you create a fancy
PrintStream subclass which does your URL post stuff, you'd be home and dry,
no?


 
Reply With Quote
 
 
 
 
Oliver Wong
Guest
Posts: n/a
 
      08-17-2005
"bitshit" <bitshit_at_hot_mail_dot_com> wrote in message
news:4303aab0$0$767$. nl...
> Hi,
>
> Is it possible to redirect java errors to post to a url? I have a generic
> library that some third party classes extend. When these third party
> classes generate errors/crash i'd like to post these errors to a script
> instead of the jvm printing it standard to the console... it concerns
> applets, the third party applets extend a super class form my library
> where I migth be able to set such a redirect?


I think this kind of stuff is usually done via exception handling,
except it assumes that you are invoking the methods which are generating the
exception, and not the other way around. (Obligatory Slashdot reference: In
Soviet Russia, methods generating exceptions invokes you!)

You could try inverting the call hiearchy, by forcing the third party
code to pass you something like a method pointer or delegate (or something
like the Command design pattern), and then your library code calls this
delegate, and catch any exception it throws, and post to whatever URL you
want.

- Oliver


 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-18-2005
On Wed, 17 Aug 2005 23:23:00 +0200, "bitshit"
<bitshit_at_hot_mail_dot_com> wrote or quoted :

>Is it possible to redirect java errors to post to a url? I have a generic
>library that some third party classes extend. When these third party classes
>generate errors/crash i'd like to post these errors to a script instead of
>the jvm printing it standard to the console... it concerns applets, the
>third party applets extend a super class form my library where I migth be
>able to set such a redirect?


Remote I/O is still in the stone age. It is not like writing to a
file. There is nothing at the other end to receive it. You have to
deal with the various exceptions that may occur. Likely the sandbox
will clamp down on you unless your Applet is signed.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Out-of-memory errors and caching errors. George1776 ASP .Net 2 09-14-2006 03:34 PM
Obsolete Errors and Deprecated Errors using Dotnet Framework 2.0 SenthilVel ASP .Net 0 06-07-2006 11:48 AM
Handling errors and not redirecting to a custom error page =?Utf-8?B?Sm9yZ2UgTWF0b3M=?= ASP .Net 2 10-29-2004 06:17 PM
Internet Explorer causing errors/ slow internet speed and Outlook express errors Jeanne Medley Computer Support 2 02-11-2004 11:44 PM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57