<< Re: Loving policies - especially mail settings | Home | Java in Notes/Domino Explained: Stack, heap and references >>

Java in Notes/Domino Explained: Tricks in the Java Debug Console

The Java Debug Console is found under File\Tools\Show Java Debug Console in the menu and this is where the output of System.out and System.err goes. There are a number of secret keyboard commands you can use to show various information. Below is a listing of these commands.

Note: The cursor has to be in the output field (the big one on the top) for the commands to work.

KeyDescription
pPrint a list of the system properties (an enumeration of System.getProperties()
dToggle debug info.
mShow memory information
gRun garbage collection
hShow help (list commands)
fFinalize objects in queue
vShow Java version information
0-9Set applet error level



Avatar: J. A. Griggs

Re: Java in Notes/Domino Explained: Tricks in the Java Debug Console

Mikkel, Do you know how to display java (agent) error messages in a Lotus Notes messagebox (or prompt)? I want the text of the errors to appear to the user as the agent is running.

Thanks,

J.A. Griggs

Re: Java in Notes/Domino Explained: Tricks in the Java Debug Console

Well you can use Swing (the Java GUI framework) to do it. The easiest is to use some of the utility classes for messageboxes. The below example should illustrate the point.

import lotus.domino.*;
import javax.swing.*;

public class JavaAgent extends AgentBase {

   public void NotesMain() {
      try {
         Session session = getSession();
         AgentContext agentContext = session.getAgentContext();
         NotesException e = new NotesException();
         e.text = "This is my message";
         e.id = 9999;
         throw e;

      } catch (NotesException e) {
         JOptionPane.showMessageDialog(null, 
            "NotesException: " + e.text + " (id: " + e.id + ")", 
            "NotesException", 
            JOptionPane.WARNING_MESSAGE);
      }
   }
}
Was this the kind of information you were after?

Avatar: Ganapathiram Natarajan

Re: Java in Notes/Domino Explained: Tricks in the Java Debug Console

The p command doesn't work for me. Everything else works. I am using R6, not 6.5. Is this command version specific?

Re: Java in Notes/Domino Explained: Tricks in the Java Debug Console

Sounds like it - I'm on Notes 7.0.1...