2014-06-30 50 views
1

Aynone得到MongoDB驅動程序使用Xpages?當MongoDB客戶端嘗試連接到它的服務器時,我在服務器控制檯上出現以下錯誤。任何人都有使用Xpages的MongoDB java驅動程序?

30.06.2014 20:32:55 HTTP JVM: java.lang.IllegalStateException: NotesContext not initialized for the thread. For more detailed information, please consult 
C:/domino/data/domino/workspace/logs 
30.06.2014 20:32:55 HTTP JVM: java.lang.IllegalStateException: NotesContext not initialized for the thread. For more detailed information, please consult 
C:/domino/data/domino/workspace/logs 
30.06.2014 20:32:55 HTTP JVM: Exception in thread "cluster-1-localhost:27017" 
30.06.2014 20:32:55 HTTP JVM: java.lang.IllegalStateException: NotesContext not initialized for the thread 
30.06.2014 20:32:55 HTTP JVM:  at com.ibm.domino.xsp.module.nsf.NotesContext.getCurrent(NotesContext.java:123) 
30.06.2014 20:32:55 HTTP JVM:  at com.ibm.domino.xsp.module.nsf.ModuleClassLoader$DynamicClassLoader.loadClass(ModuleClassLoader.java:383) 
30.06.2014 20:32:55 HTTP JVM:  at java.lang.ClassLoader.loadClass(ClassLoader.java:638) 
30.06.2014 20:32:55 HTTP JVM:  at com.mongodb.ServerMonitor$ServerMonitorRunnable.waitForSignalOrTimeout(ServerMonitor.java:162) 
30.06.2014 20:32:55 HTTP JVM:  at com.mongodb.ServerMonitor$ServerMonitorRunnable.waitForNext(ServerMonitor.java:143) 
30.06.2014 20:32:55 HTTP JVM:  at com.mongodb.ServerMonitor$ServerMonitorRunnable.run(ServerMonitor.java:120) 
[12C8:00DF-590C] 30.06.2014 20:32:55 HTTP JVM:  at java.lang.Thread.run(Thread.java:738) 

+++更新#1

一)我把需要的庫到數據庫的WEB-INF \庫,並把他們的路徑

b)本僅行導致堆棧跟蹤以上

MongoClient client = new MongoClient("localhost",27017); 
+0

你在哪裏把你的代碼。你使用了什麼代碼?代碼rulez – stwissel

+0

更新了以前的帖子... –

+0

您的問題讓我試一試,並將所有需要的jar文件複製到'jvm \ lib \ ext'文件夾中,它現在可以工作。有沒有辦法如何將瓶子作爲NSF的一部分,並避免將它們安裝到遠程服務器上無法使用的文件系統上? –

回答

4

似乎你的問題是與訪問權限。如果您想將JAR添加爲插件,而不是將它們放入jvm/lib/ext目錄(很快就會變得混亂),那麼可以將它們包裝在OSGi插件中,並將其部署到您的服務器/ Domino Designer。

6個月前,我遇到了同樣的挑戰 - 當我想出來的時候,我寫了一篇關於如何做的博客文章(其實也是兩篇 - 如何部署)。你可以在這裏看到詳細信息:http://www.dalsgaard-data.eu/blog/wrap-an-existing-jar-file-into-a-plug-in/

罐子不是數據庫的一部分 - 但是你可以爲數據庫(或者你需要的每個數據庫 - 因爲它們對所有人都可用)啓用它們。

HTH ;-)

/約翰

+0

令人難以置信,但也幫助我! ) –

相關問題