[问题] 关于IBM lotus Notes的Exception补抓

楼主: u9423504 (缘投农夫)   2016-02-12 15:17:18
各位前辈好:
小弟目前的专案有一个需求,那就是使用Notes来寄公司的内部信。
小弟的实做方式是使用Notes Client的API调用Notes Client来达到寄信功能。
目前这支的程式已经实做出来了,而且能正常运作。
然而,在 RESTful Web Service 的程式中,调用那一支寄信的程式,使用try/catch
却补抓不到 NotesException的异常讯息。
程式码节录如下:
(1)MailSent程式码节录:
import lotus.domino.Database;
import lotus.domino.Document;
import lotus.domino.EmbeddedObject;
import lotus.domino.NotesFactory;
import lotus.domino.NotesThread;
import lotus.domino.RichTextItem;
import lotus.domino.RichTextStyle;
import lotus.domino.Session;
import lotus.domino.NotesException;
public class MailSent extends NotesThread{
String pwd;
String attche;
String NameNsf;
String Subject;
String SentTo;
String Name;
Document MailContent =null;
Session session= null;
public MailSent(String pwd,String attche,String NameNsf,String subject,String
sent){
this.pwd= pwd;
this.attche= attche;
this.NameNsf = NameNsf;
this.Subject=subject;
this.SentTo=sent;
}
public void runNotes()throws NotesException {
session = NotesFactory.createSessionWithFullAccess(pwd);
.
.
.
(省略)
MailContent.sent(false,SentTo);
}
}
作者: asship (孤帆远影)   2016-02-13 11:53:00
是否为多执行绪的问题呢? 发生错误的时候程式已经离开try-catch区块以前也在notes写过JAVA,好久了,你看看原厂文件他有一些范例可以参考刚刚找了一下以前写的笔记,发信不需要继承notesthread如果你需要等做完之后得到结果,可以用ExecutorService不太确定你为什么开了一个执行绪之后就丢回应成功如果你有一定要继承NotesThread的理由http://0rz.tw/siSrJ 帮你找到一篇这个,我也没用过http://coach.iteye.com/blog/857358上面这个连结你再参考一下

Links booklink

Contact Us: admin [ a t ] ucptt.com