Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecoveryFailure - Error Deserializing - Unknown Discriminator #13

Closed
amarwadi opened this issue Jan 3, 2016 · 2 comments
Closed

RecoveryFailure - Error Deserializing - Unknown Discriminator #13

amarwadi opened this issue Jan 3, 2016 · 2 comments
Labels

Comments

@amarwadi
Copy link

amarwadi commented Jan 3, 2016

Hello, after downgrading Akka to 1.0.4, I was successfully able to persist events into the Akka Event Journal store in Mongo. This is with reference to an earlier issue I created here: #12

When I close the system and re-run the application, the actor tries to recover from the messages that were persisted in MongoDb. In doing so, it runs into a Recovery Failure because it cannot find the Message Type.

An error occurred while deserializing the Payload property of class Akka.Persistence.MongoDb.Journal.JournalEntry: Unknown discriminator value 'CheckSeatMessage'.

Please note that CheckSeatMessage is a class as identified in the Gist. However, this class is in a separate project. Could this be an issue? I doubt it because I placed it in the same project and still received the issue.

https://gist.github.com/amarwadi/a887b26e14b0d42191b7

Here is the JSON in MongoDB:

{
"_id" : "SectionActor_1",
"PersistenceId" : "SectionActor",
"SequenceNr" : NumberLong(1),
"IsDeleted" : false,
"Payload" : {
"_t" : "CheckSeatMessage",
"SeatKeys" : ["A", "B"],
"RowKey" : "1",
"SectionKey" : "1"
}
}

@Horusiath Horusiath added the bug label Jan 3, 2016
@marcpiechura
Copy link
Contributor

@amarwadi

From the Readme ;-)

Serialization

The events and snapshots are stored as BsonDocument, so you need to register you types with the BsonClassMap before you can use your persistence actor.
Otherwise the recovery will fail and you receive a RecoveryFailure with the message:

An error occurred while deserializing the Payload property of class : Unknown discriminator value ''

@marcpiechura
Copy link
Contributor

@Horusiath I think this one can be closed ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants