That is a bug. Please create an issue <https://github.com/akka/akka/issues>.
It's an oversight that this method can be used from the constructor, as in
this case.

Thanks,
Patrik

On Fri, Dec 11, 2015 at 3:13 AM, Nicholas Ustinov <[email protected]>
wrote:

> Hello!
>
> I'm using PersistentFSM class and i'm getting null pointer exception
>
>
> 2015-12-11 04:46:01.986 [sb-processing-akka.actor.default-dispatcher-4]
> ERROR akka.actor.OneForOneStrategy - exception during creation
> akka.actor.ActorInitializationException: exception during creation
>         at akka.actor.ActorInitializationException$.apply(Actor.scala:172)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         at akka.actor.ActorCell.create(ActorCell.scala:606)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:461)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         at akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         at
> akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
> [akka-actor_2.11-2.4.1.jar:na]
>         at akka.dispatch.Mailbox.run(Mailbox.scala:223)
> [akka-actor_2.11-2.4.1.jar:na]
>         at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
> [akka-actor_2.11-2.4.1.jar:na]
>         at
> scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
> [scala-library-2.11.7.jar:na]
>         at
> scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
> [scala-library-2.11.7.jar:na]
>         at
> scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
> [scala-library-2.11.7.jar:na]
>         at
> scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
> [scala-library-2.11.7.jar:na]
> Caused by: java.lang.NullPointerException: null
>         at
> akka.persistence.Eventsourced$class.recoveryRunning(Eventsourced.scala:407)
> ~[akka-persistence_2.11-2.4.1.jar:na]
>         at
> com.simplesys.rtm.scenario.Scenario.recoveryRunning(Scenario.scala:24)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> com.simplesys.rtm.scenimpl.yuterra.TestFSM$$anonfun$7.applyOrElse(TestFSM.scala:252)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> com.simplesys.rtm.scenimpl.yuterra.TestFSM$$anonfun$7.applyOrElse(TestFSM.scala:247)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
> ~[scala-library-2.11.7.jar:na]
>         at
> akka.persistence.fsm.PersistentFSMBase$$anonfun$handleTransition$1.apply(PersistentFSMBase.scala:396)
> ~[akka-persistence_2.11-2.4.1.jar:na]
>         at
> akka.persistence.fsm.PersistentFSMBase$$anonfun$handleTransition$1.apply(PersistentFSMBase.scala:396)
> ~[akka-persistence_2.11-2.4.1.jar:na]
>         at scala.collection.immutable.List.foreach(List.scala:381)
> ~[scala-library-2.11.7.jar:na]
>         at
> akka.persistence.fsm.PersistentFSMBase$class.handleTransition(PersistentFSMBase.scala:396)
> ~[akka-persistence_2.11-2.4.1.jar:na]
>         at
> akka.persistence.fsm.PersistentFSMBase$class.makeTransition(PersistentFSMBase.scala:477)
> ~[akka-persistence_2.11-2.4.1.jar:na]
>         at
> com.simplesys.rtm.scenario.Scenario.makeTransition(Scenario.scala:24)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> akka.persistence.fsm.PersistentFSMBase$class.initialize(PersistentFSMBase.scala:312)
> ~[akka-persistence_2.11-2.4.1.jar:na]
>         at
> com.simplesys.rtm.scenario.Scenario.initialize(Scenario.scala:24)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> com.simplesys.rtm.scenimpl.yuterra.TestFSM.<init>(TestFSM.scala:255)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> com.simplesys.rtm.scenimpl.yuterra.TestFSM$$anonfun$props$1.apply(TestFSM.scala:42)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> com.simplesys.rtm.scenimpl.yuterra.TestFSM$$anonfun$props$1.apply(TestFSM.scala:42)
> ~[processing-core_2.11-1.1-SNAPSHOT.jar:1.1-SNAPSHOT]
>         at
> akka.actor.TypedCreatorFunctionConsumer.produce(IndirectActorProducer.scala:87)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         at akka.actor.Props.newActor(Props.scala:214)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         at akka.actor.ActorCell.newActor(ActorCell.scala:562)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         at akka.actor.ActorCell.create(ActorCell.scala:588)
> ~[akka-actor_2.11-2.4.1.jar:na]
>         ... 9 common frames omitted
>
>
>
> what I'm doing:
>
> I'm trying to access recoveryRunning at onTransition handler:
>     onTransition {
>
>         case _ -> S_Begin =>
>             loggerScenario.write(ScenarioTraceItem(
>                 sStage = S_Begin.identifier,
>                 sEvent = Some("startWith")
>             ), recoveryRunning)
>     }
>
>
> while having
>
> startWith(S_Begin, StateData())
>
>
>
> Is it a bug or right behavior?
>
>
> Thanks,
>
>
> Nikolay
>
>
> --
> >>>>>>>>>> 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 [email protected].
> To post to this group, send email to [email protected].
> 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

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to