PROGRAMMING OVERVIEW AND USER INTERFACE

Debugging a Java agent with AgentRunner
From the Java IDE:

1. Select the AgentContext document by specifying <Agent><Database>[] arguments to the AgentRunner program. The arguments should be written as they appear in the "AgentContexts" view of AgentRunner.nsf. To run AgentRunner from a command line, type:


2. Set a breakpoint on any executable line of Java in the NotesMain() method of your agent.

3. Run or debug the project. If you are debugging and no breakpoints are set, you should step into NotesMain() to access your Java.

Some Java IDEs won't allow you to specify a class JAR or ZIP file for the location of a project's main() entry point. To work around this, create a dummy main application designed to call the main() method in AgentRunner. For example:

import lotus.domino.*;
public class Main
{
    public static void main (String[] args)
    {
         try
         {
              AgentRunner.main(args);
         }
         catch (Exception e)
         {
              e.printStackTrace();
         }
    }
}

See Also