I’m using JTOpen to run as JDBC connection to out iSeries.
Here’s the agent code:
= = = Start of listing = = =
import java.sql.Connection;
import java.sql.DriverManager;
import lotus.domino.AgentBase;
import lotus.domino.AgentContext;
import lotus.domino.Session;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
Connection conn = DriverManager.getConnection(
"jdbc:as400://xxx.xxx.xxx.xxx", "UserId", "password");
System.out.println("Catalog: " + conn.getCatalog());
System.out.println("Is closed? " + conn.isClosed());
} catch (Exception e) {
e.printStackTrace();
}
}
}
= = = End of listing = = =
This code runs sort of OK the first time in Designer and
the Java console output looks like this:
= = = Start of listing = = =
Catalog: OurIseriesName
Is closed? false
Error cleaning up agent threads
= = = End of listing = = =
Note the error message “Error cleaning up agent threads”.
When I run the agent again, I get this error in the Java console:
= = = Start of listing = = =
java.lang.OutOfMemoryError
= = = End of listing = = =
And in the Agent completion message in Designer:
= = = Start of listing = = =
Started running agent ‘test2’ on 01/12/2009 13:29:15
ERROR: JVM: Attempt to retrieve Java agent attachments failed.
Ran Java Agent Class
Done running agent ‘test2’ on 01/12/2009 13:29:22
= = = End of listing = = =
I’ve scanned the usual places for information, but have found only vague references to multiple threads being created. Has anyone else seen this problem? I’ve extended the code to actually pull back data from the iSeries and this works OK the first time round, retrieving rows correctly. It seems that the first time this runs, something is not terminated correctly in the JVM.
This works fine in Eclipse using the same core code.