EventStore & RavenDB Persistence JsonReaderException

白昼怎懂夜的黑 提交于 2019-12-11 11:16:23

问题


Trying to wire up JOliver's EventStore with RavenDB and hit a snag. I created a new DB in Raven called RavenEventStore.

The following is my wireup;

return Wireup.Init()
           .UsingRavenPersistence("RavenEventStore")
             .UsingAsynchronousDispatchScheduler()
                .DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
           .Build();

When the Wireup.Init() is called, this exception is occuring on the RavenDb side;

Url: "/indexes/RavenCommitByDate" Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: . Line 1, position 1. at Newtonsoft.Json.JsonTextReader.ParseValue(Char currentChar) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonTextReader.cs:line 699 at Newtonsoft.Json.JsonTextReader.ReadInternal() in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonTextReader.cs:line 499 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, Type t, JsonConverter propertyConverter) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1072 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 118 at Raven.Database.Extensions.HttpExtensions.ReadJsonObject[T](IHttpContext context) in c:\Builds\raven\Raven.Database\Extensions\HttpExtensions.cs:line 57 at Raven.Database.Server.Responders.Index.Put(IHttpContext context, String index) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 64 at Raven.Database.Server.Responders.Index.Respond(IHttpContext context) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 49 at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx) in c:\Builds\raven\Raven.Database\Server\HttpServer.cs:line 477 at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\Builds\raven\Raven.Database\Server\HttpServer.cs:line 259

I can see the exception in the RavenDB log as well;

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: . Line 1, position 1.   at Newtonsoft.Json.JsonTextReader.ParseValue(Char currentChar) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonTextReader.cs:line 699 at Newtonsoft.Json.JsonTextReader.ReadInternal() in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonTextReader.cs:line 499 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, Type t, JsonConverter propertyConverter) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1072 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 118 at Raven.Database.Extensions.HttpExtensions.ReadJsonObject[T](IHttpContext context) in c:\Builds\raven\Raven.Database\Extensions\HttpExtensions.cs:line 57 at Raven.Database.Server.Responders.Index.Put(IHttpContext context, String index) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 64 at Raven.Database.Server.Responders.Index.Respond(IHttpContext context) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 49 at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx) in c:\Builds\raven\Raven.Database\Server\HttpServer.cs:line 477 at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\Builds\raven\Raven.Database\Server\HttpServer.cs:line 259

I have attempted to eliminate all possibilities by removing the UsingAsynchronousDispatchScheduler() method as well and incur the same error. The code I am using is strictly from the Example located here: https://github.com/joliver/EventStore/blob/master/doc/EventStore.Example/MainProgram.cs

Has anyone experienced this? Have failed to find anything on Google as well.


回答1:


Ryan, You are using an older server (pre 888) with a new client (888 or later)




回答2:


Your problem may be similar to this one: EventStore + RavenDB, not deserializing correct

Also, I would definitely recommend using a custom build against Raven build 888 (or later) as Oren has suggested until I can get a new release out against a newer version of Raven.



来源:https://stackoverflow.com/questions/10455823/eventstore-ravendb-persistence-jsonreaderexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!