Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: java agent: send a memo doc in loop crashes
Feedback Type: Problem
Product Area: Domino Designer on Eclipse (DDE)
Technical Area: Functionality
Platform: ALL
Release: 8.5.1
Reproducible: Always

I have this java agent for testing( see code below). The agent completes fine, if (x<1) is specified in the for loop condition. But if I make it loop twice, then the agent (run on local designer client) seems to hang. Both messages recieved fine, but in the agent log, logging never reaches the "end" line. No error, since agent is running on local machine, the java console is always empty after I restart client....

I am new to java, so can you spot anything obviously wrong here? many thx in adv

import lotus.domino.*;
public class TestSendMemoInLoop extends AgentBase {
Session s;
AgentContext ac;
Database db;
Document memo;
Log log;
String m = new String();

public void NotesMain() {
try {
s = getSession();
ac = s.getAgentContext();
db = ac.getCurrentDatabase();
log = s.createLog("TestSendMailInLoop in " + db.getTitle() + " on " + db.getServer());
log.openNotesLog(null, "alog4.nsf");
log.logAction("started");
for (int x=0; x < 2; x++) {

memo = db.createDocument();
memo.replaceItemValue("Form", "Memo");
if (x==0)
m="A";
else
m="B";
memo.replaceItemValue("Subject", "send email in loop" + m);

memo.replaceItemValue("SendTo", "Xun.Dong@thomasmiller.com");

memo.setSaveMessageOnSend(true);
boolean suc = memo.computeWithForm(true, false);

log.logAction("about to send memo " + memo.getItemValueString("Subject"));
memo.send();

memo.recycle();
//memo=null;

}
if (memo!=null)
memo.recycle();
if (db!=null)
db.recycle();
if (ac!=null)
ac.recycle();
if (s!=null)
s.recycle();
log.logAction("end");
System.out.println("Testsendmemoinloop ended");
} catch (NotesException ne) {

ne.printStackTrace();

} catch (Exception e) {
e.printStackTrace();

}


}

}


Feedback number WEBB83CLCL created by ~Nita Brejumichekjip on 03/08/2010

Status: Open
Comments:

java agent: send a memo doc in loop... (~Nita Brejumich... 8.Mar.10)
. . RE: java agent: send a memo doc in ... (~Nita Brejumich... 8.Mar.10)
. . solutaion found! (~Nita Brejumich... 11.Mar.10)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS