altoo-ag/akka-kryo-serialization

com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException

ykhilaji opened this issue · 9 comments

Hello ,
I have a problem of deserailisation with a complex class case (see log),

Ps => despite the warning, I noticed nothing as a malfunction,

I use in my project:
akka 2.6.11 ( akka cluster , akka streams , akka pubsub )
scala 2.12,
play 2.6

log server:
[warn] 2020-11-30 19:09:31,504 - akka.remote.artery.Deserializer - Failed to deserialize message from [akka://application@127.0.0.1:2551] with serializer id [123454323] and manifest []. com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
Serialization trace:
underlying (play.api.libs.json.JsObject)
data (models.TaskModel)
task (actors.websockets.ClientActor$TaskDeleted)
[info] 2020-11-30 19:09:31,504 - actors.websockets.ClientActor - task deleted, id: 66657
[warn] 2020-11-30 19:09:31,504 - akka.remote.artery.Deserializer - Failed to deserialize message from [akka://application@127.0.0.1:2551] with serializer id [123454323] and manifest []. com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException

Which version of this library are you using?

Hi @nvollmar

i use 1.1.5 version of akka-kryo-serialization, here is the list of dependencies that I use in my project

Deps.akkaVersion = 2.6.10

"com.typesafe.play" %% "anorm" % "2.5.3",
"org.julienrf" %% "enum" % "3.1",
"com.typesafe.play" %% "play-json" % "2.6.8",
"com.typesafe.play" %% "play-json-joda" % "2.6.8",
"com.typesafe.play" %% "play-iteratees" % "2.6.1",
"com.typesafe.play" %% "play-iteratees-reactive-streams" % "2.6.1",
"org.julienrf" %% "play-jsmessages" % "3.0.0",
"org.postgresql" % "postgresql" % "9.4-1202-jdbc41",
"org.apache.pdfbox" % "pdfbox" % "1.8.10",
"org.scalaz" %% "scalaz-core" % "7.2.18",
"org.scalactic" %% "scalactic" % "3.0.4",
"com.alexitc" %% "play-request-tracer" % "0.1.0",
"com.opencsv" % "opencsv" % "3.6",
"com.zaxxer" % "HikariCP" % "2.7.5",
"ai.x" %% "play-json-extensions" % "0.10.0",
"io.altoo" %% "akka-kryo-serialization" % "1.1.5",
"org.typelevel" %% "cats-core" % "2.1.1",
"com.typesafe.akka" %% "akka-testkit" % Deps.akkaVersion % Test,
"org.scalatestplus.play" %% "scalatestplus-play" % "3.0.0" % Test,
"org.mockito" % "mockito-core" % "2.7.22" % Test,
"io.kamon" %% "kamon-bundle" % "2.0.4",
"io.kamon" %% "kamon-prometheus" % "2.0.1"
)

// Akka
libraryDependencies in ThisBuild += "com.typesafe.akka" %% "akka-actor" % Deps.akkaVersion
libraryDependencies in ThisBuild += "com.typesafe.akka" %% "akka-slf4j" % Deps.akkaVersion
libraryDependencies in ThisBuild += "com.typesafe.akka" %% "akka-cluster" % Deps.akkaVersion
libraryDependencies in ThisBuild += "com.typesafe.akka" %% "akka-cluster-tools" % Deps.akkaVersion
libraryDependencies in ThisBuild += "com.typesafe.akka" %% "akka-stream" % Deps.akkaVersion

Could you try to reproduce this in a simplified test case?

I use in my Kamon project and I think this is the cause of the excpetion,

Link project in github https://github.com/ykhilaji/play-jobs-example/

the documantion is not up to date, to launch two instances, you must launch: node 1: ./conf/script/runNode1.sh node 2: ./conf/script/runNode1.sh

to simulate a stress test : ab -m POST -k -c 250 -n 2000 http://localhost/yk/jobs/10000

There is an open issue at Kamon: kamon-io/Kamon#767

I assume there is not much we could do in this regard.

@ykhilaji Kamon has fixed their issue and released a new version see https://github.com/kamon-io/Kamon/releases/tag/v2.1.10
can you retest pls?

danischroeter

Hi danischroeter , sorry , it still does not work after updating the version of akka to 2.6.11 and kamon 2.1.10, I still have the same problem ,

Log server play:
[warn] a.r.a.Deserializer - Failed to deserialize message from [akka://application@127.0.0.1:2551] with serializer id [123454323] and manifest []. com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
Serialization trace:
underlying (play.api.libs.json.JsObject)
data (model.TaskModel)
value (scala.Some)
task (model.TaskInfra)
task (protocol.TaskComplete)

Hi @ykhilaji too bad - would have been great if it worked :(
We will need a stripped down reproducer of your issue that shows its a problem of this library. Unfortunately we do not have the time to dig into your project...

Got no response - close as stale issue. Please reopen if necessary.