我正在尝试将SecureSocial与 reactivemongo 结合使用。但是,在缓存用户时我遇到了问题。在开发过程中,每次 Play 决定重新编译文件时,用户都会注销。我认为这是由于以下错误:
[error] n.s.e.s.d.DiskStorageFactory - Disk Write of f097d7b2db41b48eb28d73fffe4a0b7af0d5723fd5ea27c3f14c21d559c4f5b7448730955aaa95700df906ac38a4b6833de0dae859d957a368d3e5028208c5ba522ffd779ac8d9e439f2c7ec516dd4ddb0005fda0a4f5cd035c3eedec717807518b4dec5f1e6781ee55125a6ae33db50cba107bb73311078d50ee947bcd92033 failed:
java.io.NotSerializableException: reactivemongo.bson.BSONObjectID
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180) ~[na:1.7.0_21]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528) ~[na:1.7.0_21]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) ~[na:1.7.0_21]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) ~[na:1.7.0_21]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) ~[na:1.7.0_21]
我不知道如何解决这个问题。我期望 BSONObjectId 默认是可序列化的,因为它是一个案例类。有什么提示吗?