Another thing I have done is obtain the stack trace using the following
code. You could then create your own Error.java object and pass that back to
the RPG program when an error occurs. 

try{
  ...
}catch(Exception e){
  String stackTrace = Log.getStackTrace(e);
   ...
}

public class Log {
...
    public static String getStackTrace(Throwable aThrowable) {
        final Writer result = new StringWriter();
        final PrintWriter printWriter = new PrintWriter(result);
        aThrowable.printStackTrace(printWriter);
        return result.toString();
    }
...
}

HTH,
Aaron Bartell


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Shane_Cessna@xxxxxxx
Sent: Monday, February 06, 2006 2:36 PM
To: JAVA400-L@xxxxxxxxxxxx
Subject: stack trace?...

Hey all,

I have an RPG program that calls a Java method.  I have the method return a
1 character value -> 0 if successful, 1 if unsuccessful.  Every time I
invoke this method, I get a 1 returned to my RPG program indicating that
something failed in my java method.  However there's no stack trace anywhere
to see what went wrong.  Is there a way for me to get the stack trace in my
job log or in a spooled file or something so I can figure out what's up with
my java method?

Shane Cessna
iSeries Programmer
North American Lighting, Inc.
(618) 662-4483 x2776
shane_cessna@xxxxxxx
--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.