1

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.

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
Ryan Anderson
  • 937
  • 10
  • 23

2 Answers2

5

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

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • Perfect. I was using build 616. Updated to 800 just to test and had the same issue but then took the next step to 888 as suggested and the problem was solved. – Ryan Anderson May 07 '12 at 17:22
0

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.

Community
  • 1
  • 1
Jonathan Oliver
  • 5,207
  • 32
  • 31
  • Updating the RavenDb per Ayende's suggestion and that solved the problem. I am currently using EventStore version 3.0.11326.44 and all seems to be well. – Ryan Anderson May 07 '12 at 17:26