title: Scala/Akka/Protobuf: Failed to serialize and deserialize message
body: <p>we are trying to using protobuf with Akka and serialize all Akka messages via protobuf. For Scala, we have a library called ScalaPB which help us to generate the class, which includes methods like <code>parseFrom</code>, <code>toByteArray</code> etc for serializing or deserialize our data. But, while we try to run the program, getting below exception: </p>
  
  <pre><code>akka.actor.dungeon.SerializationCheckFailedException: Failed to serialize and deserialize message of type com.knoldus.akkaserialization.msg.example.Bang$ for testing. To avoid this error, either disable 'akka.actor.serialize-messages', mark the message with 'akka.actor.NoSerializationVerificationNeeded', or configure serialization to support this message
  
  </code></pre>
  
  <p>application.conf file contains below configuration: </p>
  
  <pre><code>akka {
      actor {
          allow-java-serialization = off
          serialize-messages = on
          serializers {
              proto = "akka.remote.serialization.ProtobufSerializer"
          }
  
          serialization-bindings {
              "com.knoldus.akkaserialization.msg.example.Bang" = proto
              "com.knoldus.akkaserialization.msg.example.Message" = proto
          }
      }
  }
  </code></pre>
  
  <p>These classes <code>com.knoldus.akkaserialization.msg.example.Bang</code> and <code>com.knoldus.akkaserialization.msg.example.Message</code> generates via ScalaPB and contains all require methods. </p>
  
  <p>Source code of <code>akka.remote.serialization.ProtobufSerializer</code> define, </p>
  
  <pre><code>This Serializer serializes `akka.protobuf.Message` and `com.google.protobuf.Message` It is using reflection to find the `parseFrom` and `toByteArray` methods to avoid dependency to `com.google.protobuf`
  </code></pre>
  
  <p>So, we expecting, this automatically reads our case classes <code>Bang</code> and <code>Message</code> and perform serialization, but unfortunately getting serialization exception. </p>
  
  <p>Could you help to figure out what exact problem with ScalaPB and ProtoBuff? </p>