首页 文章

EventStore和RavenDB持久性JsonReaderException

提问于
浏览
1

试图将JOliver's EventStoreRavenDB连接起来并遇到麻烦 . 我在Raven中创建了一个名为RavenEventStore的新数据库 .

以下是我的连线;

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

当调用Wireup.Init()时,RavenDb端会发生此异常;

Url:“/ indexes / RavenCommitByDate”Newtonsoft.Json.JsonReaderException:解析值时遇到意外的字符: . 第1行,第1位,位于Newtonoft.Json.JsonTextReader.ParseValue(Char currentChar)的d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ JsonTextReader.cs:第699行,位于Newtonsoft.Json.JsonTextReader.ReadInternal ()在d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ JsonTextReader.cs:第4行,位于d:\中的Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader,Type t,JsonConverter propertyConverter)开发\发布\ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:第10行,位于d:\ Development \ Releases \ Json中的Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader,Type objectType) \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:位于c:\ Builds \ raven \ Raven.Database \ Extensions \ HttpExtensions.cs中Raven.Database.Extensions.HttpExtensions.ReadJsonObject [T](IHttpContext context)的第118行:第57行在Raven.Database.Server.Responders.Index.Put(IHttpContext conte xt,String index)在c:\ Builds \ raven \ Raven.Database \ Server \ Responders \ Index.cs:第64行,位于c:\ Builds \ raven中的Raven.Database.Server.Responders.Index.Respond(IHttpContext context) \ Raven.Database \ Server \ Responders \ Index.cs:位于c:\ Builds \ raven \ Raven.Database \ Server \ HttpServer.cs:第477行的Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx)第49行c:\ Builds \ raven \ Raven.Database \ Server \ HttpServer.cs中的Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx):第259行

我也可以在RavenDB日志中看到异常;

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

我试图通过删除UsingAsynchronousDispatchScheduler()方法消除所有可能性并产生相同的错误 . 我使用的代码严格来自这里的示例:https://github.com/joliver/EventStore/blob/master/doc/EventStore.Example/MainProgram.cs

有没有人经历过这个?在Google上也找不到任何东西 .

2 回答

  • 0

    Ryan,您正在使用较旧的服务器(pre 888)和新客户端(888或更高版本)

  • 5

    您的问题可能与此类似:EventStore + RavenDB, not deserializing correct

    此外,我肯定会建议使用针对Raven build 888(或更高版本)的自定义构建,因为Oren已经建议,直到我可以针对较新版本的Raven获得新版本 .

相关问题