in OSGi, creating an Actor from another bundle throws an Exception with unrelated message
having two bundles, the first importing the second and creating an actor using the second throws the (already seen) Exception :
2013-01-10 15:42:48,961 | ERROR | ult-dispatcher-7 | camel_proxy_routee | ? ? | 105 - camel_proxy_routee - 3.0.0.SNAPSHOT |
aea4997a-5fcc-47e8-9d72-51e67227f715akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:169)
at akka.actor.ActorCell.create(ActorCell.scala:496)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:351)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:256)
at akka.dispatch.Mailbox.run(Mailbox.scala:211)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:502)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: 95d424f0-9d31-43f6-aa09-6ce6788d8294akka.actor.ActorInitializationException:
You cannot create an instance of [io.xtech.cf.xcloud.dumb.Dumb] explicitly using the constructor (new).
You have to use one of the factory methods to create a new actor. Either use:
'val actor = context.actorOf(Props[MyActor])' (to create a supervised child actor from within an actor), or
'val actor = system.actorOf(Props(new MyActor(..)))' (to create a top level actor from the ActorSystem)
at akka.actor.ActorInitializationException$.apply(Actor.scala:170)
at akka.actor.Actor$class.$init$(Actor.scala:381)
at io.xtech.cf.xcloud.dumb.Dumb.<init>(Dumb.scala:14)
at io.xtech.cf.xcloud.routee.osgi.Activator$$anonfun$1.apply(Activator.scala:82)
at io.xtech.cf.xcloud.routee.osgi.Activator$$anonfun$1.apply(Activator.scala:82)
at akka.actor.ActorCell.newActor(ActorCell.scala:461)
at akka.actor.ActorCell.create(ActorCell.scala:479)
... 8 more
this error is thrown by the first bundle, when the first bundle call
with Dumb imported from the second.
May be related with 2864# on ClassLoader in OSGi
https://www.assembla.com/spaces/akka/tickets/2864#/activity/ticket:
2013-01-10 15:42:48,961 | ERROR | ult-dispatcher-7 | camel_proxy_routee | ? ? | 105 - camel_proxy_routee - 3.0.0.SNAPSHOT |
aea4997a-5fcc-47e8-9d72-51e67227f715akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:169)
at akka.actor.ActorCell.create(ActorCell.scala:496)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:351)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:256)
at akka.dispatch.Mailbox.run(Mailbox.scala:211)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:502)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: 95d424f0-9d31-43f6-aa09-6ce6788d8294akka.actor.ActorInitializationException:
You cannot create an instance of [io.xtech.cf.xcloud.dumb.Dumb] explicitly using the constructor (new).
You have to use one of the factory methods to create a new actor. Either use:
'val actor = context.actorOf(Props[MyActor])' (to create a supervised child actor from within an actor), or
'val actor = system.actorOf(Props(new MyActor(..)))' (to create a top level actor from the ActorSystem)
at akka.actor.ActorInitializationException$.apply(Actor.scala:170)
at akka.actor.Actor$class.$init$(Actor.scala:381)
at io.xtech.cf.xcloud.dumb.Dumb.<init>(Dumb.scala:14)
at io.xtech.cf.xcloud.routee.osgi.Activator$$anonfun$1.apply(Activator.scala:82)
at io.xtech.cf.xcloud.routee.osgi.Activator$$anonfun$1.apply(Activator.scala:82)
at akka.actor.ActorCell.newActor(ActorCell.scala:461)
at akka.actor.ActorCell.create(ActorCell.scala:479)
... 8 more
this error is thrown by the first bundle, when the first bundle call
actorSystem.actorOf(Props[Dumb], "dumb")
with Dumb imported from the second.
May be related with 2864# on ClassLoader in OSGi
https://www.assembla.com/spaces/akka/tickets/2864#/activity/ticket:
Leave a comment