[JAVA-455] Unexpected java.lang.NullPointerException at DBCursor.hasNext() Created: 20/Oct/11  Updated: 25/Jun/13  Resolved: 24/Oct/11

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.6.5
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Konstantin V. Borisov Assignee: Antoine Girbal
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian 5 Lenny 32bit
MongoDB 2.0.0
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)



 Description   

java.lang.NullPointerException
        at sun.nio.ch.Util$BufferCache.get(Util.java:74)
        at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:144)
        at sun.nio.ch.IOUtil.read(IOUtil.java:174)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)
        at sun.nio.ch.SocketAdaptor$SocketInputStream.read(SocketAdaptor.java:176)
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:86)
        at com.mongodb.DBPort._read(DBPort.java:219)
        at com.mongodb.DBPort.go(DBPort.java:91)
        at com.mongodb.DBPort.call(DBPort.java:58)  
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:158)
        at com.mongodb.DBApiLayer$MyCollection.find(DBApiLayer.java:297)
        at com.mongodb.DBCursor._check(DBCursor.java:253)
        at com.mongodb.DBCursor._hasNext(DBCursor.java:374)
        at com.mongodb.DBCursor.hasNext(DBCursor.java:399)

This happened 12 times this morning. And once a couple of days before. Any thoughts what it could be? Can it be because of some incompartibilities between driver and DB versions?

If you assist I can turn on some additional logging to be able to help to catch the problem.



 Comments   
Comment by Scott Hernandez (Inactive) [ 24/Oct/11 ]

Yes, it is possible. See if you have memory overcommit enabled.

Comment by Konstantin V. Borisov [ 24/Oct/11 ]

Unfortunately I can not reproduce the issue in controlled environment either...

This happened in production environment and I was not able to reproduce it in development and test environments.

I forgot to mention when described the issue enviroment, that this happened on hosting and server is running under the OpenVZ.

How do you think, can this (OpenVZ) be the cause?

Comment by Scott Hernandez (Inactive) [ 24/Oct/11 ]

This looks like a jvm bug and we cannot reproduce it; if you have any code to help please post it to reopen this issue. We will keep an eye for more reports like this.

Generated at Thu Feb 08 08:52:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.