我正在使用带有scala的Hazelcast 3.5 我有一个案例类Abc我试图在我的客户端使用hazelcast存储我的类的对象,但它给了我一些序列化异常
这是我的班级
@SerialVersionUID(1)
case class Abc( id : Int ,name : String , subjectCode : MutableList[Int]) extends Serialable
当我运行客户端代码时,它会给我以下异常
18:33:43.274 [hz._hzInstance_1_dev.partition-operation.thread-1] ERROR c.h.map.impl.operation.PutOperation - [192.168.15.20]:5701 [dev] [3.5] java.lang.ClassNotFoundException: scala.collection.mutable.MutableList
com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: scala.collection.mutable.MutableList
at com.hazelcast.nio.serialization.DefaultSerializers$ObjectSerializer.read(DefaultSerializers.java:201) ~[hazelcast-3.5.jar:3.5]
at com.hazelcast.nio.serialization.StreamSerializerAdapter.read(StreamSerializerAdapter.java:41) ~[hazelcast-3.5.jar:3.5]
at com.hazelcast.nio.serialization.SerializationServiceImpl.toObject(SerializationServiceImpl.java:276) ~[hazelcast-3.5.jar:3.5]
at com.hazelcast.map.impl.mapstore.AbstractMapDataStore.toObject(AbstractMapDataStore.java:78) ~[hazelcast-3.5.jar:3.5]
答案 0 :(得分:1)
您的群集必须使用与您的客户相同的代码库(在本例中为scala jar)运行。