Hi Peter
> val remoteAddress = sender.path.address > val actor = context.actorOf(Props(new > PlayerHub(pid)).withDeploy(Deploy(scope = RemoteScope(remoteAddress))), > "playerHub-" + pid) > The reason why it needs to be serialized is in the line above: you try to deploy an actor remotely and you probably close over the enclosing class. Where is this PlayerHub class declared? See this: http://doc.akka.io/docs/akka/2.3.0-RC1/scala/actors.html#Dangerous_Variants and this: http://doc.akka.io/docs/akka/2.3.0-RC1/scala/actors.html#Recommended_Practices > > the first problem I run into is a* java.io.NotSerializableException: * > *ClusterAwareSuperPlayerHub* thrown on node A, which I tried resolving by > marking it as Serializable just to see what would happen. I am wondering > though why the singleton is being serialized though? In my case it could be > large and contains a significant amount of state, not something I want to > be sent around under the covers. > > Once I've marked it as serializable, I encountered on node B: > *java.io.InvalidClassException: > ClusterAwareSuperPlayerHub; no valid constructor *which I assume is > because it does not have a default constructor? It only has one constructor > taking some service dependencies, I provided this implicitly through the > props that was given to ClusterSingletonManager.props(), obviously not > being used here. > What do you mean by "implicitly"? Is it a Scala implicit parameter? > > Why is node A sending node B a serialized copy of the singleton? My > understanding is that only the ClusterSingletonManager would create an > instance of the singleton if needed (remote oldest node drops off etc) by > using the supplied props. > > As an aside, looking at the cluster sharding pattern next, would be nice > to get rid of the "SuperPlayerHub" and manually maintaining that location > state of the PlayerHub actors (one per player cluster wide). > > Thank you > Peter > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://akka.io/faq/ > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/groups/opt_out. > -- Akka Team Typesafe - The software stack for applications that scale Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/groups/opt_out.
