-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Deserialize JSON Exception? #2105
Comments
Have you found the discussion in #299? |
@sergeybykov Thanks for providing the discussion :) . I got some useful information. But I have a question , why the Orleans can get the actor successfully at the first time?then I replaced the original JSON file with the modified then threw an exception? |
Doesn't Newtonsoft throw the same exception if you try to deserialize the modified JSON even outside of Orleans? |
@sergeybykov this.State.InfoArgs =command.InfoArgs .ToJson();//Dictionary InfoArgs property to JsonConvert.SerializeObject |
Which storage provider are you using, if any ? Also can you describe or provide an example of how you modified JSON ? Take a note that the serialization configuration which is used by Orleans is very strict. I think it's like this (it might be from older version of orleans, but key point here is
Try to deserialize your modified json using these settings and let us know about the results.
we found that messing with it causes Json.NET go pretty nuts |
@centur
original JSON file in the MS Azure Blob content and I deleted original one, and replaced the following : Just changed the value "ErrorId:155" to "ErrorId:000", and restart the SILO then threw the exception
First can parsing json,second dead...:( ,may you explain the situation? Thanks.. |
Sorry for a delayed reply. This doesn't look right. Azure Blob Storage provider, as far as I know, must serialize data with types , are you 100% sure you haven't disabled Also this error with no copier found. It seems that it's related to a bit different problem actually - we had this error when we tried to pass JObject to a grain or read JObject from a grain. It works ok when you're running just a single silo (e.g. in dev or local debugging) but fails when you're running in a cluster - when jObject is being passed to other server - runtime is trying to serialize it ( when it's on a single silo - some optimisations come in play and they conseal this problem )
If this helps - the issue is not in the Blob Storage provider... |
@centur CASE1
Result: CASE2
Result: |
Are you implementing your own blob storage provider ? |
also re: observed behaviour - are you changing the state in the second case when the grain is still in memory ? This part :
When grain is still in memory - normally it doesn't re-read the state, thus you are actually reading the state object that is in memory and was set by your previous Second time - the json you pasted before is not really a json that built-in blob storage provider stores - built-in one stores it with |
Hi all, this is my code , one property of the class,
public Dictionary<string, object> InfoArgs { get; set; }
First time,I use the method
SaveStateAsync
,and the .JSON file in the MS blob,and then I modified the .JSON file and replaced the original JSON file.
Next time ,I start the VS debug mode ,set as project with SILO host,and got the excption "System.Runtime.Serialization.SerializationException: Type 'Newtonsoft.Json.Linq.JObject' in Assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' is not marked as serializable."
I found similar issue in the https://gitter.im/dotnet/orleans/archives/2015/07/21
Our MS orleans version is V1.2.3, Newtonsoft is V7+
I am not sure that is my code has some problem or others.
Anybody have some ideas?Thanks.
The text was updated successfully, but these errors were encountered: