Skip to Content
author's profile photo
Former Member

Tracking Exceptions in SAP NetWeaver Developer Studio

Where do printStackTrace and System.out.println get printed in WAS (SAP Web AS 6.4)?

I have written a program where the JSP makes use of EJB(entity bean) to access the Database. A Java bean is used to communicate between the EJB and JSP.

An SQLException was encountered during the process. But I am not able to view the details of the Exception since front end in use is the JSP.

Can anyone come up with an appropriate solution?

Thanks in advance,

PU

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Sep 30, 2005 at 05:07 AM

    Hi Pavithra,

    Welcome to SDN family. Now about your question.

    All the StackTrace are saved in the log file in the trace file at the server side. Moreover instead of System.out.println() you must use <b>System.err.println()</b> this will print whatever you want to print. Since all the println statement goes to Stack trace, thats why you need to use System.err.println() in the code.

    To view these logs file, there are many ways..

    1) Go to

    <b><your_installation_Drive>\usr\sap\<System_ID>\JC00\j2ee\cluster\server0\log\</b>

    Here you will see the .trc file. See that trace file(<b>defaultTrace.0.trc</b>) all the logs are maintained here. Your System.err.println() will be also printing the message in this trace file.

    2) You can view the same log file from Administrator console, path is <b><your_installation_Drive>\usr\sap\<System_ID>\JC00\j2ee\admin</b>. Start <b>Go.bat</b>, this will start the Administrator console. There you will find a log Viewer where you can view this trace file as well.

    Let me give you a sample code, for how this System.err.println code will work:

    For eg, this is the catch block of a try statement:

    catch(Exception e)
    {
    System.err.println("Pavithra this is a error" +e);
    }

    Now when you will see the trace file this line with the exception string will be printed there.

    I hope this solves your problem.

    Regards

    Pravesh

    PS: Please consider rewarding points for helpful answers on SDN.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 30, 2005 at 08:55 AM

    Hi PU,

    see Unable to see System.out outputs

    Hope it helps

    Detlev

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 04, 2005 at 07:34 AM

    Thank you very much for the answers... Now I am able to track down the problem.

    Add comment
    10|10000 characters needed characters exceeded