# when i change java serializer to jackson seralizer

**URL:** <https://discuss.akka.io/t/when-i-change-java-serializer-to-jackson-seralizer/6933>\
**Category:** Akka Libraries\
**Created:** [July 24, 2020, 8:51am UTC](https://discuss.akka.io/t/when-i-change-java-serializer-to-jackson-seralizer/6933 "2020-07-24T08:51:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![selim.guvenc](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@selim.guvenc](https://discuss.akka.io/u/selim.guvenc)\
**Post date:** [July 24, 2020, 8:51am UTC](https://discuss.akka.io/t/when-i-change-java-serializer-to-jackson-seralizer/6933/1 "2020-07-24T08:51:46Z")

</div>

ERROR akka.remote.EndpointWriter - Failed to serialize remote message [class akka.actor.ActorSelectionMessage] using serializer [class akka.remote.serialization.MessageContainerSerializer]. Transient association error (association remains live)  
akka.remote.MessageSerializer$SerializationException: Failed to serialize remote message [class akka.actor.ActorSelectionMessage] using serializer [class akka.remote.serialization.MessageContainerSerializer].  
at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:67)  
at akka.remote.EndpointWriter.$anonfun$serializeMessage$1(Endpoint.scala:1033)  
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)  
at akka.remote.EndpointWriter.serializeMessage(Endpoint.scala:1033)  
at akka.remote.EndpointWriter.writeSend(Endpoint.scala:893)  
at akka.remote.EndpointWriter$$anonfun$4.applyOrElse(Endpoint.scala:865)  
at akka.actor.Actor.aroundReceive(Actor.scala:537)  
at akka.actor.Actor.aroundReceive$(Actor.scala:535)  
at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:540)  
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:577)  
at akka.actor.ActorCell.invoke(ActorCell.scala:547)  
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)  
at akka.dispatch.Mailbox.run(Mailbox.scala:231)  
at akka.dispatch.Mailbox.exec(Mailbox.scala:243)  
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)  
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)  
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)  
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)  
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)  
Caused by: akka.serialization.DisabledJavaSerializer$JavaSerializationException: Attempted to serialize message using Java serialization while `akka.actor.allow-java-serialization` was disabled. Check WARNING logs for more details.

---

<div class="post-metadata">

**Author:** ![johanandren](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/johanandren/32/85_2.png) [@johanandren](https://discuss.akka.io/u/johanandren)\
**Post date:** [July 24, 2020, 1:24pm UTC](https://discuss.akka.io/t/when-i-change-java-serializer-to-jackson-seralizer/6933/2 "2020-07-24T13:24:48Z")

</div>

`ActorSelectionMessage` is handled by `akka.remote.serialization.MessageContainerSerializer` from the akka-remote module (registered through its `reference.conf`) and should never be serialized by the Java serializer.

I’d guess something wrong with your config overriding that somehow. Go through your `application.conf` serializer configuration and double check that it is correct. You can also look at the effective config used by setting `akka.log-config-on-start = on` and check the logs for configured serializers.

---

<div class="post-metadata">

**Author:** ![selim.guvenc](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@selim.guvenc](https://discuss.akka.io/u/selim.guvenc)\
**Post date:** [July 24, 2020, 1:39pm UTC](https://discuss.akka.io/t/when-i-change-java-serializer-to-jackson-seralizer/6933/3 "2020-07-24T13:39:43Z")

</div>

the situation is as you mentioned. i changed application.conf file. But now i received another error when i push message from one microservice actor to other microservice actor.

UnhandledMessage(com.common.message.global.ObjectMessage@45f6cc36,Actor[akka.tcp://dispatch-actor-system@127.0.0.1:2553/user/$c#1989792206],Actor[akka://dispatch-actor-system/user/integrationMaster/$a#-419826769])

My last serializer configuration is illustrated below;

actor {  
provider = “akka.cluster.ClusterActorRefProvider”

```
enable-additional-serialization-bindings = on
allow-java-serialization = off

serializers {
  jackson-json = "akka.serialization.jackson.JacksonJsonSerializer"
}

serialization-bindings {
  "com.common.message.db.EntityMessage" = jackson-json
  "com.common.message.db.EntityResultMessage" = jackson-json
  "com.common.message.global.ObjectMessage" = jackson-json
  "com.common.message.global.ObjectResultMessage" = jackson-json
  "com.common.message.global.jackson.JsonSerializer" = jackson-json
}

```

}

JsonSerializer is my marker interface

Thanks.

---

<div class="post-metadata">

**Author:** ![johanandren](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/johanandren/32/85_2.png) [@johanandren](https://discuss.akka.io/u/johanandren)\
**Post date:** [July 24, 2020, 3:19pm UTC](https://discuss.akka.io/t/when-i-change-java-serializer-to-jackson-seralizer/6933/4 "2020-07-24T15:19:23Z")

</div>

`UnhandledMessage` is published to the event bus when an actor receives a message that it does not handle, first actorref is sender second is the recipient which did not handle the message.

So in your case your anonymous child `$a` of `integrationMaster` did not handle the `ObjectMessage` that anonymous actor `$c` sent to it.
