Serialization error after disabling java serialization

I tried disabling Java serialization with below config. My cluster remoting is through netty tcp

#Disable Java serialization = off = on

#enable this in local.conf (non production) = on = on

I am getting below stacktrace, I don’t want to put Java serialization back, any help appreciated.

[INFO] [10/27/2019 11:35:12.052] [main] [akka.cluster.Cluster(akka://test-akka-cluster)] Cluster Node [akka.tcp://test-akka-cluster@] - Starting up, Akka version [2.5.26] ...
[ERROR] [10/27/2019 11:35:12.069] [] [akka://test-akka-cluster/system/cluster] pre-creation serialization check failed at [akka://test-akka-cluster/system/cluster/core]
java.lang.IllegalArgumentException: pre-creation serialization check failed at [akka://test-akka-cluster/system/cluster/core]
	at akka.cluster.ClusterDaemon.createChildren(ClusterDaemon.scala:224)
	at akka.cluster.ClusterDaemon$$anonfun$receive$1.applyOrElse(ClusterDaemon.scala:233)
	at akka.cluster.ClusterDaemon.aroundReceive(ClusterDaemon.scala:186)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268)
	at akka.dispatch.Mailbox.exec(Mailbox.scala:241)
	at akka.dispatch.forkjoin.ForkJoinTask.doExec(
	at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(
	at akka.dispatch.forkjoin.ForkJoinPool.runWorker(
Caused by: No configured serialization-bindings for class [akka.cluster.JoinConfigCompatChecker$$anon$1]
	at akka.serialization.Serialization.serializerFor(Serialization.scala:332)
	at akka.serialization.Serialization.findSerializerFor(Serialization.scala:307)
	at scala.collection.LinearSeqOptimized.forall(LinearSeqOptimized.scala:85)
	at scala.collection.LinearSeqOptimized.forall$(LinearSeqOptimized.scala:82)
	at scala.collection.immutable.List.forall(List.scala:89)

I’d recommend disabling = on, what it does is try to serialize all props used to start actors, but not all props were meant to be remotely deployed so props will never be sent to other nodes, in this case it is an internal cluster actor which will never be remotely deployed failing the serialization check. = on has the same problem but for messages, so can also be problematic in that it will require that any message sent, even completely internal messages that are never sent across network must have a serializer or be marked with when that is enabled.

Thank you! Probably this has to be updated in the documentation

According to doc, it is ok to enable below properties in local for debugging = on = on

Yes that could probably be clarified. A test that starts cluster can probably not be considered local, so just running your local tests without cluster (akka.provider = local) should let you enable those test settings without problems.

As a side note, in the long run we’ll probably want to provide a serialization testkit for verifying messages more explicitly. Moving forward with the typed APIs in 2.6 there is no way to do remote deploy, so that we will probably leave as it is for the “classic” actor API.

1 Like