You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i try to map this back to a class it gives me an error:
readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is NULL.
Stacktrace:
ERROR [2017-01-07 15:03:58,066] com.washingtonpost.dropwizard.exceptions.mappers.RuntimeExceptionMapper: readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is NULL.
! org.bson.BsonInvalidOperationException: readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is NULL.
! at org.bson.AbstractBsonReader.verifyBSONType(AbstractBsonReader.java:692)
! at org.bson.AbstractBsonReader.checkPreconditions(AbstractBsonReader.java:724)
! at org.bson.AbstractBsonReader.readStartDocument(AbstractBsonReader.java:452)
! at eu.dozd.mongo.EntityCodec.decode(EntityCodec.java:63)
! at eu.dozd.mongo.EntityCodec.decode(EntityCodec.java:69)
! at com.mongodb.operation.CommandResultArrayCodec.decode(CommandResultArrayCodec.java:52)
! at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:53)
! at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:84)
! at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:41)
! at org.bson.codecs.configuration.LazyCodec.decode(LazyCodec.java:47)
! at org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:101)
! at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:56)
! at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:84)
! at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:41)
! at com.mongodb.connection.ReplyMessage.<init>(ReplyMessage.java:57)
! at com.mongodb.connection.CommandProtocol.getResponseDocument(CommandProtocol.java:139)
! at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:118)
! at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168)
! at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
! at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176)
! at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216)
! at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:207)
! at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:113)
! at com.mongodb.operation.FindOperation$1.call(FindOperation.java:516)
! at com.mongodb.operation.FindOperation$1.call(FindOperation.java:510)
! at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:431)
! at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:404)
! at com.mongodb.operation.FindOperation.execute(FindOperation.java:510)
! at com.mongodb.operation.FindOperation.execute(FindOperation.java:81)
! at com.mongodb.Mongo.execute(Mongo.java:836)
! at com.mongodb.Mongo$2.execute(Mongo.java:823)
! at com.mongodb.OperationIterable.iterator(OperationIterable.java:47)
! at com.mongodb.OperationIterable.forEach(OperationIterable.java:70)
! at com.mongodb.OperationIterable.into(OperationIterable.java:82)
! at com.mongodb.FindIterableImpl.into(FindIterableImpl.java:171)
.
.
.
How can i fix this? Is this an error when mapping back to POJOs?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi there,
JSON in MongoDB 3.x:
Class to map to:
My code, that retrieves the values from mongodb:
When i try to map this back to a class it gives me an error:
readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is NULL.
Stacktrace:
How can i fix this? Is this an error when mapping back to POJOs?
Thanks!
The text was updated successfully, but these errors were encountered: