我試圖在我現有的Spring應用程序中採用that示例。不過,我得到這個錯誤:com.mongodb.MongoInternalException:DBPort.findOne失敗
Error creating bean with name 'mongo': Invocation of init method failed; nested exception is com.mongodb.MongoInternalException: DBPort.findOne failed
我得到管理面板與網址:
http://localhost:28017/
所以我應該使用28017或27017的端口號在我的配置文件。我試圖用2.2而不是2.4如Java連接器,但我得到不同的錯誤:當我搜索一下吧,但我不知道如何解決它
com.mongodb.DBTCPConnector$MyPort error
SEVERE: MyPort.error called
java.io.EOFException
at org.bson.io.Bits.readFully(Bits.java:32)
...
第二誤差可能與喬達。
有關解決問題的任何想法?
PS1:
我使用我的配置文件:
<bean id="mongoTemplate" class="org.springframework.data.document.mongodb.MongoTemplate">
<constructor-arg ref="mongo"/>
<constructor-arg value="userMongoDb"/>
<constructor-arg value="mycollection"/>
</bean>
在該行
但是:
<constructor-arg ref="mongo"/>
它說:
can no resolve bean mongo
在我的Intellij IDEA。爲什麼它這樣做,我不明白,因爲一切似乎都沒問題。
PS2:
我使用Ubuntu 11.4 64位的服務器上。首先錯誤可能與我的操作系統有關。
PS3:
當我使用2.5.2作爲蒙戈Java驅動程序我得到這個錯誤:
com.mongodb.DBTCPConnector fetchMaxBsonObjectSize
WARNING: null
java.io.EOFException
at org.bson.io.Bits.readFully(Bits.java:37)
...
PS4:
There is another question,我會檢查錯誤與Ubuntu軟件中心相關或不相關。