java.lang.ClassCastException: com.mongodb.gridfs.GridFSDBFile cannot be cast to com.mongodb.casbah.gridfs.GridFSDBFileSafeJoda
at com.mongodb.casbah.gridfs.GridFS.findOne(GridFS.scala:214) ~[org.mongodb.casbah-gridfs_2.11-2.7.1.jar:2.7.1] at com.mongodb.casbah.gridfs.GridFS.findOne(GridFS.scala:221) ~[org.mongodb.casbah-gridfs_2.11-2.7.1.jar:2.7.1] at com.fontyou.factory.services.FileService.findFileById(FileService.scala:46) ~[services.services-0.1-SNAPSHOT.jar:0.1-SNAPSHOT]
...
def findFileById(id: String): Option[Blob] = { val doc = try { gridFS.findOne(whereIdIs(id)) } catch { case e:java.lang.ClassCastException if(e.getMessage() == "com.mongodb.gridfs.GridFSDBFile cannot be cast to com.mongodb.casbah.gridfs.GridFSDBFileSafeJoda") => { log.warn(e.getMessage + " try again") gridFS.findOne(whereIdIs(id)) } } doc.map(toBlob) }
--
You received this message because you are subscribed to the Google Groups "mongodb-casbah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-users+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-users+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-u...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mongodb-casbah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-users+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mongodb-casbah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-users+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-u...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mongodb-casbah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mongodb-casbah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-casbah-u...@googlegroups.com.
This is bizarre -
what versions of Scala and Casbah are you running?