2017-04-11 32 views
0

直到最近,我都能夠通過Java和NotesFactory訪問我的Notes應用程序,這些應用程序都位於本地機器和服務器的副本上。在兩種情況下,我現在都有以下錯誤。如果我試圖用db.open()打開數據庫,它不會成功,達到1%並失敗。除了幾周前最近增加的官方發展援助之外,我想不出有什麼理由說明爲什麼幾年來的工作都失敗了。無法使用NotesFactory訪問Notes應用程序

任何幫助將不勝感激。

使用這兩種方法和相關參數的錯誤示例。螺紋

Session s = NotesFactory.createSessionWithFullAccess(); 

異常 「主要」 NotesException:數據庫木衛三!! NCLCMS.nsf一直沒有拉開尚未

Session s = NotesFactory.createSessionWithFullAccess("mypassword"); 

異常線程 「main」 NotesException:該ID文件被其他進程鎖定。稍後再試

Session s = NotesFactory.createSession((String)null, (String)null, "mypassword"); 

線程「main」中的異常NotesException:ID文件被另一個進程鎖定。再試一次後

Session s = NotesFactory.createSession() 

異常線程 「main」 NotesException:數據庫木衛三!! NCLCMS.nsf一直沒有拉開尚未

Session s = NotesFactory.createSession((String)null, (String)null,(String)null); 

異常線程 「main」 NotesException:數據庫木衛三!NCLCMS .nsf尚未打開

作爲示例,以下工作正常,直到最近。

import lotus.domino.Database; 
import lotus.domino.Document; 
import lotus.domino.NotesException; 
import lotus.domino.NotesFactory; 
import lotus.domino.Session; 
import lotus.domino.View; 
import lotus.notes.NotesThread; 

public class AssignItemParentType { 

public static void main(String[] args) throws NotesException{ 
    assignItemParentType(); 
} 

public static void assignItemParentType() throws NotesException{ 
    NotesThread.sinitThread(); 
    Session s = NotesFactory.createSessionWithFullAccess(); 

    Database db = s.getDatabase("Ganymede","NCLCMS.nsf"); 
    View itmView = db.getView("Itm Sales Order Form Internal"); 
    String parentID = null; 
    String docType = null; 
    Document parentDoc = null; 
    Document itmDoc = itmView.getFirstDocument(); 
    Document oldDoc = null; 
    int cnt=0; 
    int x=0; 
    while (itmDoc !=null){ 
     try{ 
     parentID = itmDoc.getItemValueString("ItmParentUID"); 
     parentDoc = db.getDocumentByUNID(parentID); 
     docType = parentDoc.getItemValueString("Form"); 
     if (docType.equals("SOFInt")){ 
      cnt++; 
      itmDoc.replaceItemValue("ItmParentType","Core"); 
      itmDoc.save(); 
     } 
     parentDoc.recycle(); 
     }   
     catch (Exception e){System.out.println("Error with ID"); 
    } 
     x++; 
    oldDoc = itmView.getNextDocument(itmDoc); 
    itmDoc.recycle(); 
    itmDoc = oldDoc; 

    } 
    itmView.recycle(); 
    db.recycle(); 

    System.out.println("Matches ="+cnt + " Records = "+x); 

    NotesThread.stermThread(); 

} 
+0

如何在服務器上安裝ODA?如果它通過更新站點,它不能用於代理,它只能通過HTTP任務加載,因此不會影響Java代理。官方發展援助本身使用'NotesFactory.createSession()'。 –

+0

註釋9客戶端和可能的修訂包版本對Java安全性進行了更改。我不記得詳細信息,但客戶端最近是否已更新? –

+0

嗨保羅。 ODA使用和更新站點進行安裝。我使用Java'測試項目'而不是nsf。 –

回答

0

排序與..

的Session = NotesFactory.createSessionWithFullAccess( 「輸入mypassword」);

如果您嘗試沒有密碼(以前的工作),您必須重新啓動Notes和Designer,然後進行更改。對某些人來說可能是顯而易見的,因爲現在大約4個小時後,對我來說是這樣!

相關問題