On Friday, April 6, 2012 7:05:41 PM UTC-7, MG wrote:
> I am stuck again with the following exception. It is thrown five seconds
> after I call MailPlugin.send
> 2012-04-06 18:58:01,049 - [ERROR] - from play in
> application-akka.actor.default-dispatcher-3
> Waiting for a promise, but got an error: null
> akka.pattern.AskTimeoutException: null
> at akka.dispatch.DefaultPromise.result(Future.scala:839)
> [akka-actor.jar:2.0]
> at akka.dispatch.Await$.result(Future.scala:74) ~[akka-actor.jar:2.0]
> at play.api.libs.concurrent.AkkaPromise.await(Akka.scala:43)
> ~[play_2.9.1.jar:2.0]
> at play.api.libs.concurrent.Promise$class.await(Promise.scala:44)
> ~[play_2.9.1.jar:2.0]
> at play.api.libs.concurrent.AkkaPromise.await(Akka.scala:28)
> ~[play_2.9.1.jar:2.0]
> at play.api.libs.concurrent.Promise$class.value(Promise.scala:42)
> ~[play_2.9.1.jar:2.0]
> at play.api.libs.concurrent.AkkaPromise.value(Akka.scala:28)
> ~[play_2.9.1.jar:2.0]
> at
> play.api.libs.concurrent.Promise$$anonfun$extend1$1.apply(Promise.scala:40)
> [play_2.9.1.jar:2.0]
> at
> play.api.libs.concurrent.Promise$$anonfun$extend1$1.apply(Promise.scala:40)
> [play_2.9.1.jar:2.0]
> at
> play.api.libs.concurrent.AkkaPromise$$anonfun$extend$2$$anonfun$apply$3.app ly(Akka.scala:37)
> [play_2.9.1.jar:2.0]
> at
> scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala: 110)
> [scala-library.jar:na]
> at
> scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala: 110)
> [scala-library.jar:na]
> at scala.util.control.Exception$Catch.apply(Exception.scala:88)
> [scala-library.jar:na]
> at scala.util.control.Exception$Catch.either(Exception.scala:110)
> [scala-library.jar:na]
> at play.api.libs.concurrent.STMPromise.redeem(Promise.scala:166)
> [play_2.9.1.jar:2.0]
> at
> play.api.libs.concurrent.AkkaPromise$$anonfun$extend$2.apply(Akka.scala:37)
> [play_2.9.1.jar:2.0]
> at
> play.api.libs.concurrent.AkkaPromise$$anonfun$extend$2.apply(Akka.scala:37)
> [play_2.9.1.jar:2.0]
> at akka.dispatch.Future$$anonfun$onFailure$1.apply(Future.scala:480)
> [akka-actor.jar:2.0]
> at akka.dispatch.Future$$anonfun$onFailure$1.apply(Future.scala:479)
> [akka-actor.jar:2.0]
> at
> akka.dispatch.DefaultPromise.akka$dispatch$DefaultPromise$$notifyCompleted( Future.scala:907)
> [akka-actor.jar:2.0]
> at
> akka.dispatch.DefaultPromise$$anonfun$tryComplete$1$$anonfun$apply$mcV$sp$4 .apply(Future.scala:884)
> [akka-actor.jar:2.0]
> at
> akka.dispatch.DefaultPromise$$anonfun$tryComplete$1$$anonfun$apply$mcV$sp$4 .apply(Future.scala:884)
> [akka-actor.jar:2.0]
> at
> scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala: 59)
> [scala-library.jar:0.11.2]
> at scala.collection.immutable.List.foreach(List.scala:45)
> [scala-library.jar:0.11.2]
> at
> akka.dispatch.DefaultPromise$$anonfun$tryComplete$1.apply$mcV$sp(Future.sca la:884)
> [akka-actor.jar:2.0]
> at
> akka.dispatch.Future$$anon$4$$anonfun$run$1.apply$mcV$sp(Future.scala:386)
> [akka-actor.jar:2.0]
> at akka.dispatch.Future$$anon$4$$anonfun$run$1.apply(Future.scala:378)
> [akka-actor.jar:2.0]
> at akka.dispatch.Future$$anon$4$$anonfun$run$1.apply(Future.scala:378)
> [akka-actor.jar:2.0]
> at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
> [scala-library.jar:na]
> at akka.dispatch.Future$$anon$4.run(Future.scala:378)
> [akka-actor.jar:2.0]
> at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:83)
> [akka-actor.jar:2.0]
> at
> akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381 )
> [akka-actor.jar:2.0]
> at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
> [akka-actor.jar:2.0]
> at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997)
> [akka-actor.jar:2.0]
> at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495)
> [akka-actor.jar:2.0]
> at
> akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
> [akka-actor.jar:2.0]
> 2012-04-06 18:58:16,322 - [ERROR] - from application in
> application-akka.actor.default-dispatcher-5
> MailPlugin error:Generic error: Exception reading response
> Any idea what could be causing this exception?
> On Friday, April 6, 2012 6:03:43 PM UTC-7, MG wrote:
>> I found out what was the problem; I made a rookie mistake. Looking at
>> source code again, I realize that it is returning Promise, which I was
>> ignoring in my code. I am still having some other problem, but at least now
>> I know why the browser was becoming non-responsive.
>> On Friday, April 6, 2012 1:05:39 PM UTC-7, MG wrote:
>>> Hi - I was wondering if anyone is able to use the mail-plugin in a
>>> production environment successfully?
>>> I have included it in my app, but unable to get it working. For some
>>> reason, the plugin hangs when I call MailPlugin.send(m). My app never gets
>>> the control back so the entire app freezes at that point.
>>> I looked at the mail-plugin source, but couldn't figure out the issue.
>>> Here are the source code for the send method:
>>> private def sendMessage(msg:Email)(implicit app:Application):Promise[Boolean] = {
>>> import akka.util.Timeout
>>> implicit val timeout = Timeout(Duration(5, "seconds"))
>>> (MailWorker.ref ? (msg)).mapTo[Boolean].asPromise //FIX-ME, switch to fire and forget
>>> }
>>> There is a comment that says FIX-ME, but I have no clue how to fix it.
>>> I would appreciate if you could tell me what may be the problem and how do I fix it?
>>> It would also helpful to know if anyone is able to use the mail-plugin successfully in a production environment by just following the direction in the readme file.
>>> Thanks,
>>> MG