Hi Björn,

today I found out that the root cause seems to be the length of the fully 
qualified class name of the snapshot class. If the length (pacakge+class 
name) exceeds 60 characters an EOFException is thrown instead of calling 
fromBinary.

Here's my reference.conf:

akka {
  actor {
    serializers {
        customSerializer = "com.handler.util.CommonSerializer"
    }
    serialization-bindings {
        "com.handler.common.dispatcher.xxxxxxxxxxxxxxxxxxx.MySnapshot" = 
customSerializer
    }
  }
}

Here's the scala file where I define the MySnapshot class:

package com.handler.common.dispatcher.xxxxxxxxxxxxxxxxxxx

@SerialVersionUID(1L)
case class MySnapshot(id: String)

Here's the common serializer:

package com.handler.util

class CommonSerializer extends Serializer {
  def includeManifest: Boolean = true
  def identifier = 5177

  def toBinary(obj: AnyRef): Array[Byte] = {
    val outputStream = new ByteArrayOutputStream()
    outputStream.toByteArray
  }

  def fromBinary(bytes: Array[Byte],
                 clazz: Option[Class[_]]): AnyRef = {
    None
  }
}

If I make the package name shorter it works without throwing an 
EOFException - fromBinary is called then.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to