users
[Top] [All Lists]

Re: [cinjug-users] printStackTrace prints nothing

To: lei.han@xxxxxxxxxxxxx, users@xxxxxxxxxx
Subject: Re: [cinjug-users] printStackTrace prints nothing
From: Abdul Habra <ahabra@xxxxxxxxx>
Date: Fri, 18 Aug 2006 08:13:32 -0700 (PDT)
Delivered-to: mailing list users@cinjug.org
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=wHcJR+3rbjaspzrIcRJqV9ocJGBvsaT0hmaYlF+2jC9Mqo8hRbOnVGbCWU4zj+iPJmXdNOMb+QyVTbdFynVvQ1jodIFxxrpC9EJnmM+4VEI7sMF5m0la9t7+Y0TbqKQPHDc4fBvTHNTycO8zR+3HvbdkS9/8VirhOOMxyzNnHug= ;
In-reply-to: <OFE62180E9.BF7A75D7-ON852571CE.004E0CC7-852571CE.0051C72A@nd.convergys.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
you need to flush the PrintWriter before calling toString()
also remember to close it.

lei.han@xxxxxxxxxxxxx wrote:






My code has logic like

java.io.StringWriter writer = new java.io.StringWriter();
e.printStackTrace(new java.io.PrintWriter(writer));
String stackTraceString = writer.toString();

buf.append(stackTraceString);

LOG.error(buf);

But in my log file I only see

java.lang.NullPointerException

There is no stack trace after it and also no print out like <trace available>>

How come the stack trace of java.lang.NullPointerException has not been
printed out?

Thanks!

Lei Han || Home : (248) 6149056 Cell: (513)6074271
--
"NOTICE: The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential. If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected."


---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx




Thank You,
Abdul Habra


Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
<Prev in Thread] Current Thread [Next in Thread>