I am using MongoDb and am having trouble reading records from the database. I can get them at the cursor, but when I try to get entries from the cursor using cursor.hasNext () this gives me the following exception:
com.mongodb.MongoInternalException: couldn't get next element at com.mongodb.DBCursor.hasNext(DBCursor.java:459) Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:146) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at org.bson.io.Bits.readFully(Bits.java:35) at org.bson.io.Bits.readFully(Bits.java:28) at com.mongodb.Response.<init>(Response.java:35) at com.mongodb.DBPort.go(DBPort.java:101) at com.mongodb.DBPort.go(DBPort.java:66) at com.mongodb.DBPort.call(DBPort.java:56) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:211) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:220) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:220) at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:266) at com.mongodb.DBCursor._check(DBCursor.java:309) at com.mongodb.DBCursor._hasNext(DBCursor.java:431) at com.mongodb.DBCursor.hasNext(DBCursor.java:456)
Perhaps I ran into this problem, as my data is constantly increasing, so I get more entries in the cursor. An accessible database is also located on the remote machine.
Please help us with this.
Thanks!
source share