Hi,
I had created a java agent with two classes, One is main class i.e. class1 and another is class2.
The agent gets successfully compiled on saving, but on running the agent in web, it gives me error at the line where I am setting AgentContext i.e.
AgentContext agentContext1 = session1.getAgentContext();
Plzz help.
import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
String currdocid;
AgentContext agentContext = session.getAgentContext();
Agent agent = agentContext.getCurrentAgent();
Database db = agentContext.getCurrentDatabase();
RequestDetail obj1 = new RequestDetail();
String req1 = obj1.getRequestData("docid");
} catch(Exception e) {
e.printStackTrace();
}
}
}
import lotus.domino.*;
public class RequestDetail extends AgentBase
{
String getRequestData(String docid)
{
try
{
Session session1 = getSession();
AgentContext agentContext1 = session1.getAgentContext(); // Here error is coming
Database db1 = agentContext1.getCurrentDatabase();
String title = db1.getTitle();
System.out.println(title);
}
catch(Exception e) {
e.printStackTrace();
}
return "hello";
}
}
Regards,
Rinkal