Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Better Java error messages

Reply
Thread Tools

Better Java error messages

 
 
Chris Head
Guest
Posts: n/a
 
      06-15-2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

DJ Majestik wrote:
[snip]
> The more information given to a programmer, the more they are going to
> be successful at figuring out what is going on. My frustration is the
> lack of information a stack trace gives, and that it doesn't spit out
> any system out information. Although this is logged to a file on the
> server, there is no easy way for me to match the specific error in the
> stack trace to the system out to gather that information.

[snip]

Hi,
I guess a way you might try doing this is to use a Logger instead of
System.out on the server, and then to explicitly catch all Exceptions in
the client at the top level and reprint them with a timestamp. Then you
can match the timestamp up (at least to within a couple of minutes) with
the Logger messages coming from the server. The Logger automatically
adds a timestamp to every message it produces.

It's not perfect, but it'll certainly narrow things down a bit. Of
course, this also requires that you have access to the source of the
entire system to replace all the System.outs with Logger calls, but
that's neither here nor there - it's just a suggestion.

Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)

iD8DBQFCsGy4gxSrXuMbw1YRAqKgAKDd4s5V/wdpq38VXJ8paDGsUS9kRgCfRFh0
OKk5r8308nuXSzhDzTovp3Y=
=B8xb
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
 
John Currier
Guest
Posts: n/a
 
      06-15-2005
> It's not perfect, but it'll certainly narrow things down a bit.

It'll narrow things down, but not by much if you've got several
thousand concurrent requests on your server/in your logs.

John

 
Reply With Quote
 
 
 
 
John Currier
Guest
Posts: n/a
 
      06-15-2005
You can usually look at the line that caused the NullPointerException
and figure out what was null. Normally many of the candidates will
have been referenced prior to the failing line and can therefore be
removed as a candidate. Ideally you'll end up with a single plausible
culprit.

John
http://schemaspy.sourceforge.net

 
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
FAQ 9.3 How can I get better error messages from a CGI program? PerlFAQ Server Perl Misc 0 04-03-2011 04:00 AM
Getting better Template error messages in terminal? none C++ 3 05-12-2010 11:01 AM
Build a Better Blair (like Build a Better Bush, only better) Kenny Computer Support 0 05-06-2005 04:50 AM
i sent 2 messages about double messages monique Computer Support 0 11-27-2004 07:18 PM
will all these messages cause a problem . I am a new subscriber and my computer is downloading 100,000 messages. Will this cause any kind of a problem with my ability to store other items?? Camille White Camille White Computer Support 9 11-08-2004 01:13 AM



Advertisments