Monthly Archives: December 2011

Debug Java From Lotus Notes Designer

We do not prefer to write agents in Java just because we are not able to debug the Java agent in Lotus Notes Designer. As we think Designer do not have any debugger for Java, but let me clarify that Lotus Notes Designer 8.5.x (also known as Domino Designer in Eclipse) has in-built Java debugger.

It is very clear that to write a Java agent we must extend AgentBase class and implement notesmain() function. So if our Java agent requires Domino Infrastructure to execute then how can we debug it? We have to make it a Java application to debug it. So we must define main function in our Java agent.

I am assuming the name of the agent class is MyAgent.

protected Session _goSession;
protected AgentContext _goCtx;

public MyAgent(){}

public MyAgent(Session s, AgentContext c) {
_goSession = s;
_goCtx = c;

public static void main(String[] args) {
Session s = null;


try {
s = NotesFactory.createSession();
// NotesMain(), the way Domino does
MyAgent a = new MyAgent(s, s.getAgentContext());

} catch (Exception e) {
} finally {
try {
if (s != null) s.recycle();
} catch (Exception x) {}
} // end main


After adding above code to your Java agent switch to Java Debugger Perspective and goto Debug Configuration and double click on Java Application in left side. Check stop in main option and click on debug button to start debugging.

I hope this helps you in debugging your Java agent. If any query feel free to write me back…:)

Disable X in Dojo Dialog

I found a trick to disable [x] on the top right corner of dojo dialog and force user to click on the close button to close the dialog box. Create a div element in your html web page and pass its id to following function to achieve this: