BsonSerializer can only be used with BsonGenerator

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web29

  • via GitHub by cowtowncoder
    , 10 months ago
    BsonSerializer can only be used with BsonGenerator
  • BsonSerializer can only be used with BsonGenerator
  • Can not write number, expecting field name
  • Stack trace

    • com.fasterxml.jackson.core.JsonGenerationException: BsonSerializer can only be used with BsonGenerator at de.undercouch.bson4jackson.serializers.BsonSerializer.serialize( at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue( at com.fasterxml.jackson.databind.ObjectMapper.writeValue( at com.fasterxml.jackson.databind.util.TokenBuffer.writeObject( at com.fasterxml.jackson.databind.util.TokenBuffer.copyCurrentEvent( at com.fasterxml.jackson.databind.util.TokenBuffer.copyCurrentStructure( at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject( at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType( at com.fasterxml.jackson.databind.deser.impl.TypeWrappedDeserializer.deserialize( at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose( at com.fasterxml.jackson.databind.ObjectMapper.readValue( at com.fasterxml.jackson.databind.ObjectMapper$readValue$ Source) at

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.