Indeed.  One thing that is especially tricky is how the lifecycle of your 
own actor system integrates with the tests.  If you don't clean up properly 
you can wind up inadvertently reusing actors across test suites which can 
get quite confusing if they're at all stateful.

On Thursday, February 19, 2015 at 5:36:24 PM UTC+7, Patrik Nordwall wrote:
>
>
>
> On Wed, Feb 18, 2015 at 1:20 PM, Roland Kuhn <goo...@rkuhn.info 
> <javascript:>> wrote:
>
>> Hi Ashesh,
>>
>> I take that this is the same as the StackOverflow question you opened 
>> around the same time. As a quick recap: your issue is that your ActorSystem 
>> on the Play side is configured without remoting because otherwise you get 
>> bind errors, which is indicative of you creating multiple ActorSystems, 
>> possibly inadvertently. In order to get help in these free forums it would 
>> be nice to acknowledge that the problem does indeed not lie with the free 
>> products you are using.
>>
>> Otherwise I agree with Ryan in that Play’s default ActorSystem (as 
>> exposed by the “Akka” object) is best avoided for the purpose of remoting. 
>> Simply create your own ActorSystem using 
>> ConfigFactory.loadConfig().getConfig("my-sub-config") and supplying the 
>> configuration for your actor system in that config scope.
>>
>
> One thing to be careful with though. When you create your own actor system 
> in play you must also manage its life cycle to avoid resource leaks in 
> development mode, i.e. you must shutdown the actor system when play is 
> reloading.
> That is probably the reason why Ryan recommended a plugin.
>
> Regards,
> Patrik
>  
>
>>
>> Regards,
>>
>> Roland
>>
>> 17 feb 2015 kl. 14:46 skrev Ashesh Ambasta <ashesh....@gmail.com 
>> <javascript:>>:
>>
>> Same issue with Play 2.3.6 and Akka 2.3.6, spent a day trying all kinds 
>> of workarounds and nothing worked.
>>
>> Proof that technologies like these will take time to become reliable for 
>> companies. A day lost looking for hopeless solutions to problems like these 
>> is too much for young startups, and this is what makes people like us avoid 
>> all of this. Truly disappointed.
>>
>> On Monday, 28 April 2014 09:41:07 UTC+2, Raymond Tay wrote:
>>>
>>> Hi Akka users,
>>>
>>> I've got a situation that's perplexing. It began with Akka 2.3.2 and i 
>>> have a Play 2.3-M1 attempting to connect to a Akka 2.3.2 actor (part of a 
>>> cluster named TrailingHammer) and it's not able to do so by throwing an 
>>> error message like the following:
>>>
>>> play.api.Application$$anon$1: Execution exception[[MatchError: 
>>> Some(Failure(akka.actor.ActorNotFound: Actor not found for: 
>>> ActorSelection[Anchor(akka://application/deadLetters), 
>>> Path(/user/ShadowFrontend)])) (of class scala.Some)]]
>>> at play.api.Application$class.handleError(Application.scala:297) 
>>> ~[play_2.10-2.3-M1.jar:2.3-M1]
>>> at play.api.DefaultApplication.handleError(Application.scala:403) 
>>> [play_2.10-2.3-M1.jar:2.3-M1]
>>> at play.core.server.netty.PlayDefaultUpstreamHandler$$
>>> anonfun$2$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:318)
>>>  
>>> [play_2.10-2.3-M1.jar:2.3-M1]
>>> at play.core.server.netty.PlayDefaultUpstreamHandler$$
>>> anonfun$2$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:318)
>>>  
>>> [play_2.10-2.3-M1.jar:2.3-M1]
>>> at scala.Option.map(Option.scala:145) [scala-library.jar:na]
>>> Caused by: scala.MatchError: Some(Failure(akka.actor.ActorNotFound: 
>>> Actor not found for: ActorSelection[Anchor(akka://application/deadLetters), 
>>> Path(/user/ShadowFrontend)])) (of class scala.Some)
>>>
>>> The code in the Play controller looks like this:
>>>
>>> lazy val config = ConfigFactory.load("TrailingHammer")
>>>
>>> lazy val notificationHost = config.getString("bamboo.
>>> persistence.cluster.hostname")
>>> lazy val notificationPort = config.getInt("bamboo.
>>> persistence.cluster.port")
>>> lazy val notificationServiceName = config.getString("bamboo.
>>> persistence.cluster.name")
>>> implicit lazy val timeOut = Timeout(config.getInt("bamboo.
>>> persistence.cluster.query.timeout") seconds) 
>>>
>>> val backend = Akka.system.actorSelection(RootActorPath(backendAddress) 
>>> / "user" / "ShadowFrontend")
>>>
>>>  
>>>
>>> This code is pretty idiomatic and i've used this successfully in Akka 
>>> [2.2.3] and wasn't too sure what's going on but the message on 
>>> *Path(/user/ShadowFrontend)* seems not to be catching the entire path 
>>> which should read like "akka.tcp://TrailingHammer@127.0.0.1:2553/user/
>>> ShadowFrontend" and when i plugged this string directly into the code 
>>> and restarted all my services, it gave me the following error message 
>>> repeatedly indicating that somehow the default actor for handling these 
>>> faults have died as well. :
>>>
>>> [INFO] [04/28/2014 15:36:58.380] 
>>> [application-akka.actor.default-dispatcher-3] 
>>> [akka://application/deadLetters] Message [java.lang.String] from Actor[
>>> akka://application/deadLetters] to Actor[akka://application/deadLetters] 
>>> was not delivered. [1] dead letters encountered. This logging can be turned 
>>> off or adjusted with configuration settings 'akka.log-dead-letters' and 
>>> 'akka.log-dead-letters-during-shutdown'.
>>> [error] play - Cannot invoke the action, eventually got an error: 
>>> akka.pattern.AskTimeoutException: 
>>> Recipient[Actor[akka://application/deadLetters]] 
>>> had already been terminated.
>>> [error] application -
>>>
>>> ! @6i3hf3e84 - Internal server error, for (POST) [/audit] ->
>>>
>>> play.api.Application$$anon$1: Execution exception[[AskTimeoutException: 
>>> Recipient[Actor[akka://application/deadLetters]] had already been 
>>> terminated.]]
>>> at play.api.Application$class.handleError(Application.scala:297) 
>>> ~[play_2.10-2.3-M1.jar:2.3-M1]
>>> at play.api.DefaultApplication.handleError(Application.scala:403) 
>>> [play_2.10-2.3-M1.jar:2.3-M1]
>>> at play.core.server.netty.PlayDefaultUpstreamHandler$$
>>> anonfun$2$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:318)
>>>  
>>> [play_2.10-2.3-M1.jar:2.3-M1]
>>> at play.core.server.netty.PlayDefaultUpstreamHandler$$
>>> anonfun$2$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:318)
>>>  
>>> [play_2.10-2.3-M1.jar:2.3-M1]
>>> at scala.Option.map(Option.scala:145) [scala-library.jar:na]
>>> Caused by: akka.pattern.AskTimeoutException: 
>>> Recipient[Actor[akka://application/deadLetters]] 
>>> had already been terminated.
>>> at akka.pattern.AskableActorRef$.ask$extension(AskSupport.scala:132) 
>>> ~[akka-actor_2.10-2.3.2.jar:na]
>>> at akka.pattern.AskableActorRef$.$qmark$extension(AskSupport.scala:144) 
>>> ~[akka-actor_2.10-2.3.2.jar:na]
>>>
>>>
>>>
>>> Any ideas guys ? 
>>>
>>> Thanks in advance!
>>> Raymond
>>>
>>
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> *Dr. Roland Kuhn*
>> *Akka Tech Lead*
>> Typesafe <http://typesafe.com/> – Reactive apps on the JVM.
>> twitter: @rolandkuhn
>> <http://twitter.com/#!/rolandkuhn>
>>  
>>  -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
> [image: Scala Days] <http://event.scaladays.org/scaladays-sanfran-2015>
>
> 

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to