Fix exception during creation of actor

Hi Team,

I am migrating Akka 2.4 to 2.6. While doing so I have been observe below issue. I searched several forums but could not find exact fix for the same. Please assist here.

[ERROR] [03/16/2023 23:24:30.697] [default-akka.actor.internal-dispatcher-3] [akka://default/user/$a] akka.japi.pf.ReceiveBuilder.match(Ljava/lang/Class;Lakka/japi/pf/FI$UnitApply;)Lakka/japi/pf/UnitPFBuilder;
akka.actor.ActorInitializationException: akka://default/user/$a: exception during creation
	at akka.actor.ActorInitializationException$.apply(Actor.scala:196)
	at akka.actor.ActorCell.create(ActorCell.scala:664)
	at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:514)
	at akka.actor.ActorCell.systemInvoke(ActorCell.scala:536)
	at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:295)
	at akka.dispatch.Mailbox.run(Mailbox.scala:230)
	at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at akka.util.Reflect$.instantiate(Reflect.scala:73)
	at akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:101)
	at akka.actor.Props.newActor(Props.scala:226)
	at akka.actor.ActorCell.newActor(ActorCell.scala:616)
	at akka.actor.ActorCell.create(ActorCell.scala:643)
	... 9 more
Caused by: java.lang.NoSuchMethodError: akka.japi.pf.ReceiveBuilder.match(Ljava/lang/Class;Lakka/japi/pf/FI$UnitApply;)Lakka/japi/pf/UnitPFBuilder;
	at com.vndrvn.rx.akka.ExpectingActor.<init>(ExpectingActor.java:25)
	... 18 more

It’s generally not recommended to migrate directly from 2.4 to 2.6, because it’s quite possible for things to become deprecated in 2.5 and then removed in 2.6.

So therefore the general advice would be to migrate from 2.4 to 2.5 and then migrate from 2.5 to 2.6

In the 2.4 to 2.5 migration, it’s called out that the ReceiveBuilder API has been changed; it looks like that is what you might be hitting.

Thanks for the suggestion. I figured this issue is because of some of the internal dependency still using lower version of Akka. This has been fixed now.

On the other hand, about 2.4 to 2.6(specifically 2.4.1 to 2.6.19) migration plan. Are there any must do intermediate migrations if we need to perform rolling upgrade?