I've been stuck on this small piece of code for 2 days now and I don't understand what I'm doing wrong.
class Header extends Serializable {
val objectives = List[String]("1", "2", "3")
var nominalCount = 0
var inputCount = 0
var outputCount = 0
var methodType = ""
override def toString: String = {
s"NominalCount: $nominalCountn" +
s"InputCount: $inputCountn" +
s"OutputCount: $outputCountn" +
s"Type: $methodTypen" +
s"Objectives: ${objectives.toString}"
}
}
I create an instance of this class, and send it to the ActorRef like you would with any type of message sender ! header
On the receiving end I have this.
class MethodActor extends Actor {
val remote = context.actorSelection(s"akka.tcp://[email protected]:2552/user/MethodDelegate")
def receive = {
case h: Header =>
println("HEADER RECEIVED")
println(h.toString())
case s: String => println(s)
}
}
For some reason, my Header class is not being sent or received. But when I remove the val objectives declaration. It IS being sent.
Despite having var Integers and Strings, that works just fine. But collections of any kind don't work. I've tried Iterators, Collections, Maps, Vectors, Properties. Nothing works, so I must be doing something wrong.
