This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Nov 29, 2017, 1:15 PM
1 Posts

Print printstacktrace to console

  • Category: Application Development
  • Platform: Linux
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 1

I have a Java webagent that runs on a server. When it throws an error it should print the stacktrace to the console.

As an example I used a simple test agent that will generate an error (see below)

My problem is that when i call it on one server the stacktrace is printed:

hello world
java.lang.NullPointerException
    at JavaAgent.NotesMain(Unknown Source)
    at lotus.domino.AgentBase.runNotes(Unknown Source)
    at lotus.domino.NotesThread.run(Unknown Source)

But when i call it on another server just "hello world" is printed, no stacktrace.

Is there a setting where we can define this?

The server where the printstackTrace is printed is R9.0.1, where not is R8.5.3. However, this has always worked on the 9.0.1 servers when those where R8+

Sample agent:

  try 
          String[] x = null;
          System.out.println("hello world");
          x[0] ="dd";
          for (int i=0;i<4;i++)  System.out.println(x[i]);
         
      } catch(Exception e) {
          e.printStackTrace();
       }

 

Regards,
René

Dec 10, 2017, 4:54 AM
21 Posts
Try adding more code to debug the old fashioned way

Add some System.out.println before and after the loop, also before and after the stack trace. Ensure there is actually an exception happening and getting caught/handled.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal