Error: akka.dispatch.Dispatcher in application-akka.actor.default-dispatcher-6 problem in scala.concurrent internal callback

269 views
Skip to first unread message

Lorenzo Trisolini

unread,
Nov 9, 2016, 6:54:12 AM11/9/16
to Akka User List
Hi, I'm trying to use akka 2.4.12 with play 2.5.4. I'm injecting ActorSystem using "GuiceApplicationBuilder().injector()" with "system = injector.instanceOf[ActorSystem]" or "@Inject()(implicit val system: ActorSystem)" to get an instance of ActorSystem. I'm using these two mechanisms (the first one in the scala Objects and the second one in Controllers) to substitute the deprecated default akka actor system (Akka.system). I can't understand why I get this error:

[info] a.e.s.Slf4jLogger - Slf4jLogger started
[debug] p.a.l.c.ActorSystemProvider - Starting application default Akka system: application
[debug] a.e.EventStream - logger log1-Slf4jLogger started
[debug] a.e.EventStream - Default Loggers started
[info] play.api.Play - Application started (Dev)
[info] application - Resolving database...
[DEBUG] [11/09/2016 12:30:22.182] [netty-event-loop-4] [EventStream(akka://reactivemongo)] logger log1-Logging$DefaultLogger started
[DEBUG] [11/09/2016 12:30:22.182] [netty-event-loop-4] [EventStream(akka://reactivemongo)] Default Loggers started
[info] application - ReactiveMongoApi successfully configured with DB 'test'! Servers:
[localhost:27017]
[info] application - Resolving database...
[info] application - Resolving database...
[error] a.d.Dispatcher - problem in scala.concurrent internal callback
java.lang.IllegalStateException: problem in scala.concurrent internal callback
at scala.concurrent.Future$InternalCallbackExecutor$.reportFailure(Future.scala:601)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
at scala.concurrent.Promise$class.complete(Promise.scala:55)
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)
Caused by: java.lang.IllegalArgumentException: requirement failed
at scala.Predef$.require(Predef.scala:207)
at scala.concurrent.BatchingExecutor$Batch.run(BatchingExecutor.scala:51)
at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:599)
at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:72)
at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:78)

Maybe there is some errors in this code to initialize the main actors:


object ActorUtils{

 val injector
= new GuiceApplicationBuilder().injector()
 val configuration
= injector.instanceOf[Configuration]
 val messagesApi
= injector.instanceOf[MessagesApi]
 val messages
= messagesApi.preferred(Seq(Lang.defaultLang))

// val injectorGuice = Guice.createInjector(
// new ConfigModule(),
// new AkkaModule()
// )
// import net.codingwell.scalaguice.InjectorExtensions._
 
implicit val system = injector.instanceOf[ActorSystem]

 val adminAddress
= configuration.getString("emailer.adminAddress").get

 
// ----- Top-level actors with just one incarnation -----
 val userDao
= injector.instanceOf[UserDAO]

 val supervisor
=
 system
.actorOf(SupervisorActor.props(), "supervisor-actor")

 val taskDispatcher
=
 system
.actorOf(TaskDispatcher.props(supervisor), "task-dispatcher")

 val responseHandler
=
 system
.actorOf(ResponseHandler.props(supervisor, taskDispatcher), "response-handler")

 val taskStateActor
=
 system
.actorOf(TaskStateActor.props(supervisor, responseHandler, taskDispatcher), "task-state-actor")
}

I attached the application log. Thank you.
application.log
Reply all
Reply to author
Forward
0 new messages