Cannot deserialize JSON object into type 'Raven.Json.Linq.RavenJObject'

1,074 views
Skip to first unread message

Jonathan Curtis

unread,
May 18, 2011, 6:11:41 AM5/18/11
to ravendb
Getting an error when trying to save an object using the .net client.
Weirdly, the object is actually saved and I can view it in raven
studio.

Class:

public class MyClass<T> {
public string Id { get; set; }
public T Child { get; set; }
}

T is boolean

Error:

Newtonsoft.Json.JsonSerializationException: Cannot deserialize JSON
object into type 'Raven.Json.Linq.RavenJObject'.
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs: line
417
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs: line
223
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueProperty(JsonReader
reader, JsonProperty property, Object target, Boolean
gottenCurrentValue, Object currentValue) in d:\Development\Releases
\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs: line 198
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty
property, JsonReader reader, Object target) in d:\Development\Releases
\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs: line 552
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object
newObject, JsonReader reader, JsonObjectContract contract, String id)
in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json
\Serialization\JsonSerializerInternalReader.cs: line 1005
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject(JsonReader
reader, JsonObjectContract contract, String id) in d:\Development
\Releases\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs: line 842
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs: line
396
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs: line
223
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IWrappedCollection
wrappedList, JsonReader reader, String reference, JsonArrayContract
contract) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json
\Serialization\JsonSerializerInternalReader.cs: line 717
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.<>c__DisplayClass1.<CreateAndPopulateList>b__0(IList
l, Boolean isTemporaryListReference) in d:\Development\Releases\Json
\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs: line 663
at
Newtonsoft.Json.Utilities.CollectionUtils.CreateAndPopulateList(Type
listType, Action`2 populateList) in d:\Development\Releases\Json
\Working\Src\Newtonsoft.Json\Utilities\CollectionUtils.cs: line 544
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateList(JsonReader
reader, String reference, JsonArrayContract contract) in d:\Development
\Releases\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs: line 651
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue, String reference) in d:\Development\Releases\Json
\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs: line 445
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs: line
223
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader
reader, Type objectType, JsonContract contract) in d:\Development
\Releases\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs: line 208
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 Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader
reader, Type objectType) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\JsonSerializer.cs: line 420
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type
type, JsonSerializerSettings settings) in d:\Development\Releases\Json
\Working\Src\Newtonsoft.Json\JsonConvert.cs: line 719
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type
type, JsonConverter[] converters) in d:\Development\Releases\Json
\Working\Src\Newtonsoft.Json\JsonConvert.cs: line 699
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value,
JsonConverter[] converters) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\JsonConvert.cs: line 668
at Raven.Client.Connection.ServerClient.DirectBatch(IEnumerable`1
commandDatas, String operationUrl) in c:\Builds\raven
\Raven.Client.Lightweight\Connection\ServerClient.cs: line 803
at
Raven.Client.Connection.ServerClient.<>c__DisplayClass32.<Batch>b__31(String
u) in c:\Builds\raven\Raven.Client.Lightweight\Connection
\ServerClient.cs: line 778
at Raven.Client.Connection.ServerClient.TryOperation(Func`2 operation,
String operationUrl, Boolean avoidThrowing, ref T result) in c:\Builds
\raven\Raven.Client.Lightweight\Connection\ServerClient.cs: line 163
at Raven.Client.Connection.ServerClient.ExecuteWithReplication(String
method, Func`2 operation) in c:\Builds\raven\Raven.Client.Lightweight
\Connection\ServerClient.cs: line 133
at Raven.Client.Connection.ServerClient.Batch(IEnumerable`1
commandDatas) in c:\Builds\raven\Raven.Client.Lightweight\Connection
\ServerClient.cs: line 778
at Raven.Client.Document.DocumentSession.SaveChanges() in c:\Builds
\raven\Raven.Client.Lightweight\Document\DocumentSession.cs: line 344
at .....

Ayende Rahien

unread,
May 18, 2011, 8:33:49 AM5/18/11
to rav...@googlegroups.com
Can you share the full code for generating this error?

Jonathan Curtis

unread,
May 18, 2011, 10:14:37 AM5/18/11
to rav...@googlegroups.com
Just a simple save, but it is using generics, is that the problem?

public void Save<T>(string id, T child) {
    using (var session = dataStore.OpenSession()) {
        var obj = new MyClass<T> {
            Id = id,
            Child = child
        };
        session.Store(obj);
        session.SaveChanges();

Itamar Syn-Hershko

unread,
May 18, 2011, 12:29:38 PM5/18/11
to rav...@googlegroups.com
This test passes:

public class MyClass<T>
{
public string Id { get; set; }
public T Child { get; set; }
}

public void Save<T>(string id, T child) {
using (var dataStore = NewDocumentStore()){
using (var session = dataStore.OpenSession())
{
var obj = new MyClass<T>
          {
          Id = id,
          Child = child
          };
session.Store(obj);
session.SaveChanges();
}
}
}

[Fact]
public void CanSaveWithGenerics()
{
Save("myId", false);

Tim Rogers

unread,
May 19, 2011, 4:14:55 AM5/19/11
to ravendb
I get this problem as well. It doesn't seem to be to do with generics.
This test fails.

[TestClass]
public class RavenTest
{
[TestMethod]
public void TestWithoutGenerics()
{
var documentStore = new
Raven.Client.Document.DocumentStore { Url = "http://localhost:8080" };
documentStore.Initialize();
using (var session = documentStore.OpenSession())
{
var node = new TestNode
{
Id = 12345,
Latitude = 51.1f,
Longitude = 52.2f
};

session.Store(node);
session.SaveChanges();
}
}
}

public class TestNode
{
public int Id { get; set; }
public float Latitude { get; set; }
public float Longitude { get; set; }
}


Saving 1 changes to http://localhost:8080
PUT testnodes/12345
Test 'Raven.UnitTest1.TestWithoutGenerics' failed: Test method
Raven.UnitTest1.TestWithoutGenerics threw exception:
Newtonsoft.Json.JsonSerializationException: Cannot deserialize JSON
object into type 'Raven.Json.Linq.RavenJObject'..
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueProperty(JsonReader
reader, JsonProperty property, Object target, Boolean
gottenCurrentValue, Object currentValue)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty
property, JsonReader reader, Object target)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object
newObject, JsonReader reader, JsonObjectContract contract, String id)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject(JsonReader
reader, JsonObjectContract contract, String id)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IWrappedCollection
wrappedList, JsonReader reader, String reference, JsonArrayContract
contract)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.<>c__DisplayClass1.<CreateAndPopulateList>b__0(IList
l, Boolean isTemporaryListReference)
at
Newtonsoft.Json.Utilities.CollectionUtils.CreateAndPopulateList(Type
listType, Action`2 populateList)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateList(JsonReader
reader, String reference, JsonArrayContract contract)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue, String reference)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader
reader, Type objectType, JsonContract contract)
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader
reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader
reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type
type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type
type, JsonConverter[] converters)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value,
JsonConverter[] converters)
at Raven.Client.Connection.ServerClient.DirectBatch(IEnumerable`1
commandDatas, String operationUrl)
at
Raven.Client.Connection.ServerClient.<>c__DisplayClass32.<Batch>b__31(String
u)
at Raven.Client.Connection.ServerClient.TryOperation[T](Func`2
operation, String operationUrl, Boolean avoidThrowing, T& result)
at Raven.Client.Connection.ServerClient.ExecuteWithReplication[T]
(String method, Func`2 operation)
at Raven.Client.Connection.ServerClient.Batch(IEnumerable`1
commandDatas)
at Raven.Client.Document.DocumentSession.SaveChanges()
UnitTest1.cs(109,0): at Raven.UnitTest1.TestWithoutGenerics()

This is the JSON it's trying to deserialize:

[{"Etag":"00000000-0000-0500-0000-000000000014","Method":"PUT","Key":"testnodes/
12345","Metadata":{"Raven-Entity-Name":"TestNodes","Raven-Clr-
Type":"Raven.TestNode, Raven"}}]

I'm using the .NET 3.5 client if that makes a difference. Haven't
managed to test it on 4 yet.


Cheers

Itamar Syn-Hershko

unread,
May 19, 2011, 4:33:27 AM5/19/11
to rav...@googlegroups.com
This test passes too, both for client/server installation in 4.0 and 3.5, AND RavenDB Embedded (.NET 4.0 only).

What build are you using? can you try with the latest stable / unstable?

Tim Rogers

unread,
May 19, 2011, 5:12:42 AM5/19/11
to ravendb
Was using 360 - didn't work.

Just tried on 367 - seems to be fixed now.

Thanks.
> > Saving 1 changes tohttp://localhost:8080
> >        PUT testnodes/12345
> > Test 'Raven.UnitTest1.TestWithoutGenerics' failed: Test method
> > Raven.UnitTest1.TestWithoutGenerics threw exception:
> > Newtonsoft.Json.JsonSerializationException: Cannot deserialize JSON
> > object into type 'Raven.Json.Linq.RavenJObject'..
> >        at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Jso nReader
> > reader, Type objectType, JsonContract contract, JsonProperty member,
> > Object existingValue)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInter nal(JsonReader
> > reader, Type objectType, JsonContract contract, JsonProperty member,
> > Object existingValue)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValuePrope rty(JsonReader
> > reader, JsonProperty property, Object target, Boolean
> > gottenCurrentValue, Object currentValue)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue (JsonProperty
> > property, JsonReader reader, Object target)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(O bject
> > newObject, JsonReader reader, JsonObjectContract contract, String id)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulat eObject(JsonReader
> > reader, JsonObjectContract contract, String id)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Jso nReader
> > reader, Type objectType, JsonContract contract, JsonProperty member,
> > Object existingValue)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInter nal(JsonReader
> > reader, Type objectType, JsonContract contract, JsonProperty member,
> > Object existingValue)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IWr appedCollection
> > wrappedList, JsonReader reader, String reference, JsonArrayContract
> > contract)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.<>c__DisplayClas s1.<CreateAndPopulateList>b__0(IList
> > l, Boolean isTemporaryListReference)
> >         at
> > Newtonsoft.Json.Utilities.CollectionUtils.CreateAndPopulateList(Type
> > listType, Action`2 populateList)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulat eList(JsonReader
> > reader, String reference, JsonArrayContract contract)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonR eader
> > reader, Type objectType, JsonContract contract, JsonProperty member,
> > Object existingValue, String reference)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInter nal(JsonReader
> > reader, Type objectType, JsonContract contract, JsonProperty member,
> > Object existingValue)
> >         at
>
> > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonPr operty(JsonReader

Jonathan Curtis

unread,
May 19, 2011, 6:47:17 AM5/19/11
to rav...@googlegroups.com
Yes, we are using 360 too

Itamar Syn-Hershko

unread,
May 19, 2011, 6:49:23 AM5/19/11
to rav...@googlegroups.com
Jonathan, we fixed the 3.5 clients after 360, please use the latest unstable or wait for the next stable build.

wagneripjr

unread,
May 27, 2011, 10:55:30 AM5/27/11
to ravendb
I've got the same exception running the Raven.Sample.EventSourcing in
release 371 .Net4


On 19 maio, 06:49, Itamar Syn-Hershko <ita...@ayende.com> wrote:
> Jonathan, we fixed the 3.5 clients after 360, please use the latest unstable
> or wait for the next stable build.
>

Itamar Syn-Hershko

unread,
May 27, 2011, 11:08:51 AM5/27/11
to rav...@googlegroups.com
Hmm thats quite impossible now. It is more likely to be a different error.

Can you send me the exception with a full stack trace, and steps to reproduce it? As always, a simple failing test would be even better.

Itamar
Hibernating Rhinos

wagneripjr

unread,
May 28, 2011, 11:47:20 AM5/28/11
to ravendb
Well, I downloaded RavenDB-Build-371.zip and started RavenDb with
"Samples\Raven.Sample.EventSourcing\Start Raven.ps1"
Then I've started Raven.Sample.EventSourcing.csproj in VS2010, hit
enter after message "Wrote 5 events" and it throws:

Newtonsoft.Json.JsonSerializationException was unhandled
Message=Cannot deserialize JSON object into type
'Raven.Json.Linq.RavenJObject'.
Source=Newtonsoft.Json
StackTrace:
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line
417
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line
223
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueProperty(JsonReader
reader, JsonProperty property, Object target, Boolean
gottenCurrentValue, Object currentValue) in d:\Development\Releases
\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs:line 198
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty
property, JsonReader reader, Object target) in d:\Development\Releases
\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs:line 552
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object
newObject, JsonReader reader, JsonObjectContract contract, String id)
in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json
\Serialization\JsonSerializerInternalReader.cs:line 1028
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject(JsonReader
reader, JsonObjectContract contract, String id) in d:\Development
\Releases\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs:line 858
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line
396
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader
reader, Type objectType, JsonContract contract, JsonProperty member,
Object existingValue) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line
223
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader
reader, Type objectType, JsonContract contract) in d:\Development
\Releases\Json\Working\Src\Newtonsoft.Json\Serialization
\JsonSerializerInternalReader.cs:line 208
at
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader
reader, Type objectType) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line
120
at
Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader,
Type objectType) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\JsonSerializer.cs:line 421
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader
reader, Type objectType) in d:\Development\Releases\Json\Working\Src
\Newtonsoft.Json\JsonSerializer.cs:line 413
at
Raven.Client.Document.AbstractDocumentQuery`2.Deserialize(RavenJObject
result) in c:\Builds\raven\Raven.Client.Lightweight\Document
\AbstractDocumentQuery.cs:line 1357
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1
collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at
Raven.Client.Document.AbstractDocumentQuery`2.GetEnumerator() in c:
\Builds\raven\Raven.Client.Lightweight\Document
\AbstractDocumentQuery.cs:line 466
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at Raven.Sample.EventSourcing.Program.Main() in D:\RavenDb
\RavenDB-Build-371\Samples\Raven.Sample.EventSourcing\Program.cs:line
83
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Note that the program enter some kind of loop throwing this exception
and don't stop until you stop debugging.

I'm new to RavenDb but I will try to understand it better

Itamar Syn-Hershko

unread,
May 28, 2011, 2:23:12 PM5/28/11
to rav...@googlegroups.com
I run the sample from the samples solution (I launched Samples.sln), and get a different exception:

Error on request
System.InvalidOperationException: Could not find index named: Aggregates/ShoppingCart
   at Raven.Database.DocumentDatabase.<>c__DisplayClass69.<Query>b__61(IStorageActionsAccessor actions)
   at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action)
   at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action)
   at Raven.Database.DocumentDatabase.Query(String index, IndexQuery query)
   at Raven.Database.Server.Responders.Index.PerformQueryAgainstExistingIndex(IHttpContext context, String index, IndexQuery indexQuery, Guid& indexEtag)
   at Raven.Database.Server.Responders.Index.ExecuteQuery(IHttpContext context, String index, Guid& indexEtag)
   at Raven.Database.Server.Responders.Index.GetIndexQueryRessult(IHttpContext context, String index)
   at Raven.Database.Server.Responders.Index.OnGet(IHttpContext context, String index)
   at Raven.Database.Server.Responders.Index.Respond(IHttpContext context)
   at Raven.Http.HttpServer.DispatchRequest(IHttpContext ctx)
   at Raven.Http.HttpServer.HandleActualRequest(IHttpContext ctx)

We will get that fixed, but I'm interested in seeing how you got that other exception. Can you download the latest build (373 unstable) and repeat those steps with it, see if it happens again? make sure you're running it clean. Thanks.

Ayende Rahien

unread,
Jun 2, 2011, 4:32:46 AM6/2/11
to rav...@googlegroups.com
This is fixed, will be in the next build

Jean Llorca

unread,
Mar 2, 2012, 4:40:55 PM3/2/12
to rav...@googlegroups.com
I can still reproduce this error with build 701

Oren Eini (Ayende Rahien)

unread,
Mar 4, 2012, 5:54:31 AM3/4/12
to rav...@googlegroups.com
Can you create a failing test for this?

Jean Llorca

unread,
Mar 4, 2012, 6:30:13 AM3/4/12
to rav...@googlegroups.com
I was a little quick in reporting the error, it is slightly different. 
The reported error was a problem with the script to setup the sample. 

modified the loop at the end of Samples/Samples.ps1

  foreach($bundle in $bundles) 
  {
      $bundlesPath = "..\..\Bundles"
      
      if( (Test-Path "$bundlesPath\$bundle.???") -eq $false) 
      {
        $bundlesPath = "..\..\build"
      }
  
     Copy-Item  "$bundlesPath\$bundle.???" "$dest\Plugins" -ErrorAction SilentlyContinue -Force
  }

The test was before the loop. I find it quite sad that the samples don't "just work", makes testers a lot less confident about using the product.


With this fix, the index is created, but it still doesn't yield any result.
No need for a special test project, the sample as it is when downloading build 701, or the latest nightly build suffice.

I checked the index staleness, no problem.
In the studio, the index appears as compiled, with no result.

I guess this sample Raven.Samples.EventSourcing is quite old, and no one bothered updating it while API change broke it.

Would you please fix it?

Tristen Fielding

unread,
Sep 16, 2014, 1:43:50 PM9/16/14
to rav...@googlegroups.com
We are trying to evaluation Raven for our new development project, however, the Samples.sp1 is still missing from Build 2916. Can we get Samples.sp1 added to the next build and can we get a working version of EventSourcing (we understand that this example is currently broken)?

Thanks!

Oren Eini (Ayende Rahien)

unread,
Sep 16, 2014, 3:41:02 PM9/16/14
to ravendb
You can get the samples from here: https://github.com/ravendb/ravendb/tree/master/Samples
Note that this is a reply for a post from 2011



Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-7811




--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages