"Cannot create a session from an agent"

I need to open a Notes session from a java application. I can do this just fine, if I run my java app from Eclipse. But if I call my Java app from a Java agent in Domino, I get the Notes exception “Cannot create a session from an agent”. Why?

Thanks in advance.

Subject: Cannot create a session from an agent

In this case for you the DIIOP Service is enabled in the domino server. So you are able run the java program from eclipse.

Depends on the context there are different ways to achieve this.

Getting handle to the session object in eclipse and Notes Agent varies.

Below is an example for the Java Agent in Domino.

For Ex :

public class JavaAgent extends AgentBase {

public void NotesMain() {



	try {

	 	

		Session session = getSession();

		AgentContext agentContext = session.getAgentContext();

		Agent agent = agentContext.getCurrentAgent();

		Database db = agentContext.getCurrentDatabase();

For more information refer to the domino designer help ( CORBA )

Narasimha Reddy, Lomadi