cancel
Showing results for 
Search instead for 
Did you mean: 

Tracking Exceptions in SAP NetWeaver Developer Studio

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

detlev_beutner
Active Contributor
0 Kudos

Hi PU,

see

Hope it helps

Detlev

pravesh_verma
Active Contributor
0 Kudos

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.