#1820

Akka typed actors send-reply throws "No sender future in scope" on JBoss 5

    • Status: Fixed
    • Priority: High (2)
    • Component: -
    • Estimate: None/Small/Medium/Large None
    When using Akka TypedActor and invoking a send-reply method returning a Future the following exception is thrown from future factory method.

    akka.actor.IllegalActorStateException: No sender future in scope


    Full stacktrace:

    13:33:32,146 INFO  [STDOUT] MainActorImpl.handleSomething('something')
    13:33:32,184 ERROR [ContextLoader] Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pf.ActorInvoker#0' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is akka.actor.IllegalActorStateException: No sender future in scope
    [hostname_f08c1960-563e-11e1-81d2-705ab6a25759]
        at akka.actor.TypedActor$$anonfun$future$2.apply(TypedActor.scala:211)
        at akka.actor.TypedActor$$anonfun$future$2.apply(TypedActor.scala:211)
        at scala.Option.getOrElse(Option.scala:109)
        at akka.actor.TypedActor.future(TypedActor.scala:211)
        at pf.MainActorImpl.handleSomething(MainActorImpl.java:12)
        at pf.MainActor$$ProxiedByAWDelegation$$1329153188556.handleSomething(Unknown Source)
        at pf.ActorInvoker.init(ActorInvoker.java:14)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    ....
    Caused by: akka.actor.IllegalActorStateException: No sender future in scope
    [hostname_f08c1960-563e-11e1-81d2-705ab6a25759]
        at akka.actor.TypedActor$$anonfun$future$2.apply(TypedActor.scala:211)
        at akka.actor.TypedActor$$anonfun$future$2.apply(TypedActor.scala:211)
        at scala.Option.getOrElse(Option.scala:109)
        at akka.actor.TypedActor.future(TypedActor.scala:211)
        at pf.MainActorImpl.handleSomething(MainActorImpl.java:12)
        at pf.MainActor$$ProxiedByAWDelegation$$1329153188556.handleSomething(Unknown Source)
        at pf.ActorInvoker.init(ActorInvoker.java:14)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
    ...


    Versions affected: 1.1.3, 1.2, 1.3.1

    Observed on JBoss 5.1.0 GA (this is a blocker here). Not observed on JBoss 4.2.3
  • Followers
     
    Ico-users viktorklang (Assigned To) , Jonas Bonér , Peter Vlugter , piotr.findeisen 
     
    Attachments
    Associations
     
    No associations
    Activity
     
    User picture

          on Feb 14, 2012 @ 01:12am UTC * By piotr.findeisen

    Attachment typed-actor-jboss5-broken-example-project.zip added
    User picture

          on Feb 14, 2012 @ 01:26am UTC * By piotr.findeisen

    Description changed from When using Akka TypedActor ... to When using Akka TypedActor ...
    User picture

          on Feb 14, 2012 @ 02:28am UTC * By piotr.findeisen

    Description changed from When using Akka TypedActor ... to When using Akka TypedActor ...
    Priority changed from Normal (3) to High (2)
    Changed prio as this is a blocker on JBoss 5.1.0 GA
    User picture

          on Feb 20, 2012 @ 06:11pm UTC * By viktorklang

    Milestone set to Backlog
    User picture

          on Apr 08, 2012 @ 01:34am UTC * By viktorklang

    Does the problem exist on Akka 2.0?
    User picture

          on Apr 23, 2012 @ 06:17pm UTC * By viktorklang

    Status changed from New to Invalid
    User picture

          on Apr 23, 2012 @ 06:17pm UTC * By viktorklang

    Status changed from Invalid to New
    User picture

          on Apr 23, 2012 @ 06:17pm UTC * By viktorklang

    Assigned to set to viktorklang
    Status changed from New to Fixed
    Fixed in 2.0
    User picture

          on Apr 26, 2012 @ 02:18am UTC * By acruise

    I had this problem in 1.3 when running from IDEA; it seems like it was the "dynamic.classpath" option in $PROJ/.idea/workspace.xml that was at fault. I enabled it so I could use the REPL in IDEA, but it apparently causes classpath problems too. I still have no idea whether it was a direct cause of this problem, or how, but I changed it back (to "false") and it stopped throwing this exception.
    Time Expenditure
    Loading