org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.sql.Timestamp.

JIRA | Alexander Azarov | 10 months ago
  1. 0

    {{java.sql.Timestamp}} is a subclass of {{java.util.Date}}, so I didn't expect any problems. {noformat} org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.sql.Timestamp. at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:37) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.writeValue(DBObjectCodec.java:210) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.encodeMap(DBObjectCodec.java:220) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.writeValue(DBObjectCodec.java:196) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.encode(DBObjectCodec.java:128) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.encode(DBObjectCodec.java:61) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandMessage.writeTheWrites(UpdateCommandMessage.java:80) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandMessage.writeTheWrites(UpdateCommandMessage.java:42) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.BaseWriteCommandMessage.encodeMessageBodyWithMetadata(BaseWriteCommandMessage.java:129) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.RequestMessage.encodeWithMetadata(RequestMessage.java:160) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.WriteCommandProtocol.sendMessage(WriteCommandProtocol.java:212) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:101) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:64) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:37) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:159) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:286) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.DefaultServerConnection.updateCommand(DefaultServerConnection.java:140) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.UpdateOperation.executeCommandProtocol(UpdateOperation.java:76) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:141) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:133) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:230) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:221) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:133) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:60) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.Mongo.execute(Mongo.java:782) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.Mongo$2.execute(Mongo.java:765) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.executeWriteOperation(DBCollection.java:333) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.updateImpl(DBCollection.java:495) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.update(DBCollection.java:455) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.update(DBCollection.java:432) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.update(DBCollection.java:522) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.updateMulti(DBCollection.java:552) ~[mongo-java-driver-3.2.0.jar:na] {noformat}

    JIRA | 10 months ago | Alexander Azarov
    org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.sql.Timestamp.
  2. 0

    {{java.sql.Timestamp}} is a subclass of {{java.util.Date}}, so I didn't expect any problems. {noformat} org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.sql.Timestamp. at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:37) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.writeValue(DBObjectCodec.java:210) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.encodeMap(DBObjectCodec.java:220) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.writeValue(DBObjectCodec.java:196) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.encode(DBObjectCodec.java:128) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBObjectCodec.encode(DBObjectCodec.java:61) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63) ~[mongo-java-driver-3.2.0.jar:na] at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandMessage.writeTheWrites(UpdateCommandMessage.java:80) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandMessage.writeTheWrites(UpdateCommandMessage.java:42) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.BaseWriteCommandMessage.encodeMessageBodyWithMetadata(BaseWriteCommandMessage.java:129) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.RequestMessage.encodeWithMetadata(RequestMessage.java:160) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.WriteCommandProtocol.sendMessage(WriteCommandProtocol.java:212) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:101) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:64) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:37) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:159) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:286) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.connection.DefaultServerConnection.updateCommand(DefaultServerConnection.java:140) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.UpdateOperation.executeCommandProtocol(UpdateOperation.java:76) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:141) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:133) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:230) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:221) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:133) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:60) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.Mongo.execute(Mongo.java:782) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.Mongo$2.execute(Mongo.java:765) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.executeWriteOperation(DBCollection.java:333) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.updateImpl(DBCollection.java:495) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.update(DBCollection.java:455) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.update(DBCollection.java:432) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.update(DBCollection.java:522) ~[mongo-java-driver-3.2.0.jar:na] at com.mongodb.DBCollection.updateMulti(DBCollection.java:552) ~[mongo-java-driver-3.2.0.jar:na] {noformat}

    JIRA | 10 months ago | Alexander Azarov
    org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.sql.Timestamp.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Custom MapOfValuesConverter for dealing with key values containg restricted characters (., $)

    Google Groups | 1 year ago | Tom
    org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class com.frequentis.ps.persistence.mongo.integration.model.pojo.model.ComplexValue.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.bson.codecs.configuration.CodecConfigurationException

      Can't find a codec for class java.sql.Timestamp.

      at org.bson.codecs.configuration.CodecCache.getOrThrow()
    2. MongoDB Java Driver
      DBCollection.updateMulti
      1. org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46)[mongo-java-driver-3.2.0.jar:na]
      2. org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63)[mongo-java-driver-3.2.0.jar:na]
      3. org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:37)[mongo-java-driver-3.2.0.jar:na]
      4. com.mongodb.DBObjectCodec.writeValue(DBObjectCodec.java:210)[mongo-java-driver-3.2.0.jar:na]
      5. com.mongodb.DBObjectCodec.encodeMap(DBObjectCodec.java:220)[mongo-java-driver-3.2.0.jar:na]
      6. com.mongodb.DBObjectCodec.writeValue(DBObjectCodec.java:196)[mongo-java-driver-3.2.0.jar:na]
      7. com.mongodb.DBObjectCodec.encode(DBObjectCodec.java:128)[mongo-java-driver-3.2.0.jar:na]
      8. com.mongodb.DBObjectCodec.encode(DBObjectCodec.java:61)[mongo-java-driver-3.2.0.jar:na]
      9. org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)[mongo-java-driver-3.2.0.jar:na]
      10. org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)[mongo-java-driver-3.2.0.jar:na]
      11. com.mongodb.connection.UpdateCommandMessage.writeTheWrites(UpdateCommandMessage.java:80)[mongo-java-driver-3.2.0.jar:na]
      12. com.mongodb.connection.UpdateCommandMessage.writeTheWrites(UpdateCommandMessage.java:42)[mongo-java-driver-3.2.0.jar:na]
      13. com.mongodb.connection.BaseWriteCommandMessage.encodeMessageBodyWithMetadata(BaseWriteCommandMessage.java:129)[mongo-java-driver-3.2.0.jar:na]
      14. com.mongodb.connection.RequestMessage.encodeWithMetadata(RequestMessage.java:160)[mongo-java-driver-3.2.0.jar:na]
      15. com.mongodb.connection.WriteCommandProtocol.sendMessage(WriteCommandProtocol.java:212)[mongo-java-driver-3.2.0.jar:na]
      16. com.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:101)[mongo-java-driver-3.2.0.jar:na]
      17. com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:64)[mongo-java-driver-3.2.0.jar:na]
      18. com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:37)[mongo-java-driver-3.2.0.jar:na]
      19. com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:159)[mongo-java-driver-3.2.0.jar:na]
      20. com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:286)[mongo-java-driver-3.2.0.jar:na]
      21. com.mongodb.connection.DefaultServerConnection.updateCommand(DefaultServerConnection.java:140)[mongo-java-driver-3.2.0.jar:na]
      22. com.mongodb.operation.UpdateOperation.executeCommandProtocol(UpdateOperation.java:76)[mongo-java-driver-3.2.0.jar:na]
      23. com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:141)[mongo-java-driver-3.2.0.jar:na]
      24. com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:133)[mongo-java-driver-3.2.0.jar:na]
      25. com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:230)[mongo-java-driver-3.2.0.jar:na]
      26. com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:221)[mongo-java-driver-3.2.0.jar:na]
      27. com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:133)[mongo-java-driver-3.2.0.jar:na]
      28. com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:60)[mongo-java-driver-3.2.0.jar:na]
      29. com.mongodb.Mongo.execute(Mongo.java:782)[mongo-java-driver-3.2.0.jar:na]
      30. com.mongodb.Mongo$2.execute(Mongo.java:765)[mongo-java-driver-3.2.0.jar:na]
      31. com.mongodb.DBCollection.executeWriteOperation(DBCollection.java:333)[mongo-java-driver-3.2.0.jar:na]
      32. com.mongodb.DBCollection.updateImpl(DBCollection.java:495)[mongo-java-driver-3.2.0.jar:na]
      33. com.mongodb.DBCollection.update(DBCollection.java:455)[mongo-java-driver-3.2.0.jar:na]
      34. com.mongodb.DBCollection.update(DBCollection.java:432)[mongo-java-driver-3.2.0.jar:na]
      35. com.mongodb.DBCollection.update(DBCollection.java:522)[mongo-java-driver-3.2.0.jar:na]
      36. com.mongodb.DBCollection.updateMulti(DBCollection.java:552)[mongo-java-driver-3.2.0.jar:na]
      36 frames