While persisting my state update, I am getting a PersistenceFailure error 
that suggests to me that path-dependent types may be problematic for Akka 
Persistence. The error message I get is:

[ERROR] [06/09/2014 16:56:23.668] [Tests-akka.actor.default-dispatcher-5] 
> [akka://Tests/user/Tenants/jb0oz-ke6UmozLqg8DER4w] 
> PersistenceFailure(TenantAdded(Tenant(id-jb0oz-ke6UmozLqg8DER4w:TestOrg)),1,*java.io.NotSerializableException:
>  
> akka.actor.LightArrayRevolverScheduler$TaskHolder*) (of class 
> akka.persistence.PersistenceFailure)


Somehow the akka-internal akka.actor.LightArrayRevolverScheduler#TaskHolder 
is getting pulled into serialization of my event (TenantAdded). I have not 
been able to determine why this internal akka class is being serialized in 
conjunction with my event. Any insight and suggestions to investigate or 
correct is greatly appreciated!

In order to support some generalization, I've defined the Processor and 
associated classes within a module trait. (I suspect the resulting 
path-dependent type may be causing some wonkiness, however I haven't been 
able to find any concrete connection to validate this hypothesis.) 

The structure of the classes is as follows (Hopefully I'm not filtering out 
something relevant, but trying to avoid dumping a whole class. :-)):

trait TenantProcessorModule extends Serializable { outer: AuditedModule =>
>   
>   abstract override def start( ctx: Option[AnyRef] = None ): Unit = 
> trace.block("start") {
>     super.start( ctx )
>     model registerAggregateType { Props( new TenantProcessor with 
> LocalPublisher ) }
>   }
>   object TenantProcessor extends Serializable {
>     sealed trait Command {
>       def auditContext: AuditContext
>     }
>     case class AddTenant( tenant: Tenant )( implicit override val 
> auditContext: AuditContext ) extends Command
>     //...
>     sealed trait Event extends Serializable
>     case class TenantAdded( tenant: Tenant ) extends Event
>     //...
>   }
>   
>   class TenantProcessor extends EventsourcedProcessor { outer: 
> EventPublisher =>
>     //...
>   }
> }



There's obviously some complexity I could take out in order to align with 
other examples, but there's an amount of desired generalization and 
encapsulation I was hoping to support via the Module design.

Thanks, Damon

-- 
>>>>>>>>>>      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.

Reply via email to