使用Java去操作Lotus Notes,大都需要import兩個Jar:Notes.jar與NCSO.jar。只用Notes.jar還需安裝Notes Client才能與Server連,而NCSO.jar則是透過IBM制定的CORBA協議DIIOP連接到Domino Server的。
由IBM提供Sample連接,老是出現以下Exception:
Caused by: NotesException: Could not open Notes session: org.omg.CORBA.COMM_FAILURE: java.net.ConnectException: Connection refused: connect Host: 127.0.0.1 Port: 63148 vmcid: 0x0 minor code: 1 completed: No |
而由Sample程式Create Session來看,明明不是指定連Local Host。
Session s = NotesFactory.createSession("1.2.3.4:63148", "notesadmin", "password"); |
經過同事Sam大力支援,在IBM官方文件看到如下:http://www.ibm.com/developerworks/lotus/library/ls-Java_access_pt1/