AskTimeoutException : Sending to terminated ref breaks promises

604 views
Skip to first unread message

Nitin

unread,
May 26, 2012, 4:23:10 PM5/26/12
to akka...@googlegroups.com
Hi, 

When I am creating an actor I keep getting this exception. This is thrown only when I run it from command line. Through the IDE it's fine - it does not throw an AskTimeoutException.  
  
akka.pattern.AskTimeoutException: sending to terminated ref breaks promises at akka.pattern.AskSupport$class.ask(AskSupport.scala:76) at akka.pattern.package$.ask(package.scala:43) at akka.pattern.AskSupport$AskableActorRef.$qmark(AskSupport.scala:153) at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:466) at 

Following is the code used for creating the actor.

ActorSystem actorSystem = ActorSystem.create("test");

ActorRef actor = null;
if(something ...) {
  actor = actorSystem.actorOf(new Props(new UntypedActorFactory() {
    @Override
    public Actor create() {
      return new MyActor("param1", "param2");
    }
  }), "first");
}

Any help in this regards would be appreciated. 

Regards
Nitin

Roland Kuhn

unread,
May 26, 2012, 4:27:41 PM5/26/12
to akka...@googlegroups.com
Hi Nitin,

26 maj 2012 kl. 22:23 skrev Nitin:

Hi, 

When I am creating an actor I keep getting this exception. This is thrown only when I run it from command line. Through the IDE it's fine - it does not throw an AskTimeoutException.  
  
akka.pattern.AskTimeoutException: sending to terminated ref breaks promises at akka.pattern.AskSupport$class.ask(AskSupport.scala:76) at akka.pattern.package$.ask(package.scala:43) at akka.pattern.AskSupport$AskableActorRef.$qmark(AskSupport.scala:153) at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:466) at 


This means that your actorSystem is stopped already when you try to call actorOf.

Following is the code used for creating the actor.

ActorSystem actorSystem = ActorSystem.create("test");

ActorRef actor = null;
if(something ...) {
  actor = actorSystem.actorOf(new Props(new UntypedActorFactory() {
    @Override
    public Actor create() {
      return new MyActor("param1", "param2");
    }
  }), "first");
}

Could it be that there are more errors printed? Either that, or you leave out too much in this code snippet.

Regards,

Roland Kuhn
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn


Reply all
Reply to author
Forward
0 new messages