Skip to content
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

RavenDB : rd.xml editing #7895

Open
DardoTheMaster opened this issue Nov 29, 2019 · 8 comments
Open

RavenDB : rd.xml editing #7895

DardoTheMaster opened this issue Nov 29, 2019 · 8 comments

Comments

@DardoTheMaster
Copy link

@DardoTheMaster DardoTheMaster commented Nov 29, 2019

Hello, i'm trying to build a basic application which is basically a custom client for handling requests to RavenDB.

Unfortunately while trying to run the compiled application, i get the following errors:

Unhandled Exception: System.AggregateException: Failed to retrieve database topology from all known nodes.
http://127.0.0.1:8080 -> Could not build json parser for Raven.Client.Http.ServerNode -> MakeGenericMethod() cannot create this generic method instantiation because the instantiation was not metadata-enabled: 'Sparrow.Json.BlittableJsonReaderObject.TryGet<Raven.Client.Http.ServerNode.Role>(System.String,out Raven.Client.Http.ServerNode.Role&)' For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616868 (Could not build json parser for Raven.Client.Http.ServerNode)
---> System.InvalidOperationException: Could not build json parser for Raven.Client.Http.ServerNode
---> EETypeRva:0x01BDCA98(System.Reflection.MissingRuntimeArtifactException): MakeGenericMethod() cannot create this generic method instantiation because the instantiation was not metadata-enabled: 'Sparrow.Json.BlittableJsonReaderObject.TryGet<Raven.Client.Http.ServerNode.Role>(System.String,out Raven.Client.Http.ServerNode.Role&)' For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616868
at Internal.Reflection.Core.Execution.ExecutionEnvironment.GetMethodInvoker(RuntimeTypeInfo, QMethodDefinition, RuntimeTypeInfo[], MemberInfo) + 0x273
at System.Reflection.Runtime.MethodInfos.NativeFormat.NativeFormatMethodCommon.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0xb6
at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x37 at System.Reflection.Runtime.MethodInfos.RuntimeConstructedGenericMethodInfo.get_UncachedMethodInvoker() + 0x3b at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.get_MethodInvoker() + 0x19c at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo1.MakeGenericMethod(Type[]) + 0x3ec
at System.Linq.Expressions.Expression.ApplyTypeArgs(MethodInfo, Type[]) + 0xc7
at System.Linq.Expressions.Expression.FindMethod(Type, String, Type[], Expression[], BindingFlags) + 0xe0
at System.Linq.Expressions.Expression.Call(Expression, String, Type[], Expression[]) + 0xb4
at Sparrow.Json.JsonDeserializationBase.GetValue(String, Type, ParameterExpression, Dictionary`2) + 0x757
at Sparrow.Json.JsonDeserializationBase.GenerateJsonDeserializationRoutineT + 0x7d7

I tried to mess with rd.xml, but really couldn't understand how to properly configure them.
But i'm always getting errors on compiling or runtime

Thank you.

@Suchiman

This comment has been minimized.

Copy link
Contributor

@Suchiman Suchiman commented Nov 29, 2019

@DardoTheMaster see this similiar issue #7638 (comment)

@DardoTheMaster

This comment has been minimized.

Copy link
Author

@DardoTheMaster DardoTheMaster commented Nov 29, 2019

@Suchiman may i ask how you determine the assembly name ?

@Suchiman

This comment has been minimized.

Copy link
Contributor

@Suchiman Suchiman commented Nov 29, 2019

With Visual Studio:
image

@DardoTheMaster

This comment has been minimized.

Copy link
Author

@DardoTheMaster DardoTheMaster commented Nov 29, 2019

Ok so, i put together this rd.xml

<Application>
<Assembly Name="Sparrow">
	<Type Name="Sparrow.Json.BlittableJsonReaderObject" Dynamic="Required All">
		<Method Name="TryGet" Dynamic="Required All">
			<GenericArgument Name="Raven.Client.Http.ServerNode.Role, Raven.Client" />
		</Method>
  </Type>
</Assembly>

	    <Assembly Name="Raven.Client">
			<Type Name="Raven.Client.Http" Dynamic="Required All" />
			<Type Name="Raven.Client.Http.ServerNode" Dynamic="Required All" />
			<Type Name="Raven.Client.Http.ServerNode.Role" Dynamic="Required All" />
		</Assembly>
</Application>

Unfortunately, i'm getting this on compiling:

EXEC : error : [TEMPORARY EXCEPTION MESSAGE] ClassLoadGeneral: Raven.Client.Http.ServerNode.Role, Raven.Client, Version=4.2.4.0, Culture=neutral, PublicKeyToken=37f41c7f99471593 [C:\Users\Dardo\OneDrive\Progetti\DotNet\ArmaRaven\ArmaRavenDBLib\ArmaRavenDBLib.csproj]

@Suchiman

This comment has been minimized.

Copy link
Contributor

@Suchiman Suchiman commented Nov 29, 2019

I don't think you need the second <Assembly> block.
Role is a nested type (enum) inside ServerNode (class), Raven.Client.Http is the namespace.
I think the correct syntax is Raven.Client.Http.ServerNode+Role, Raven.Client

@DardoTheMaster

This comment has been minimized.

Copy link
Author

@DardoTheMaster DardoTheMaster commented Nov 29, 2019

For further reference,here's the working rd.xml file . Thank you @Suchiman

<Application>
<Assembly Name="Sparrow">
	<Type Name="Sparrow.Json.BlittableJsonReaderObject" Dynamic="Required All">
		<Method Name="TryGet" Dynamic="Required All">
			<GenericArgument Name="Raven.Client.Http.ServerNode+Role, Raven.Client" />
		</Method>
  </Type>
</Assembly>
</Application>
@DardoTheMaster DardoTheMaster changed the title RavenDB makegenericmethod(): rd.xml editing RavenDB : rd.xml editing Nov 29, 2019
@DardoTheMaster

This comment has been minimized.

Copy link
Author

@DardoTheMaster DardoTheMaster commented Nov 30, 2019

Ok unfortunately , another exception popped up again.. i fear that the tryget method of the blittablejsonreaderobject has multiple overloads...

 System.InvalidOperationException: Could not build json parser for Raven.Client.Documents.Queries.QueryResult
 ---> EETypeRva:0x01BDCC10(System.Reflection.MissingRuntimeArtifactException): MakeGenericMethod() cannot create this generic method instantiation because the instantiation was not metadata-enabled: 'Sparrow.Json.BlittableJsonReaderObject.TryGet<System.Nullable<System.Int32>>(System.String,out System.Nullable<System.Int32>&)' For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616868
   at Internal.Reflection.Core.Execution.ExecutionEnvironment.GetMethodInvoker(RuntimeTypeInfo, QMethodDefinition, RuntimeTypeInfo[], MemberInfo) + 0x273
   at System.Reflection.Runtime.MethodInfos.NativeFormat.NativeFormatMethodCommon.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0xb6
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x37
   at System.Reflection.Runtime.MethodInfos.RuntimeConstructedGenericMethodInfo.get_UncachedMethodInvoker() + 0x3b
   at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.get_MethodInvoker() + 0x19c
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.MakeGenericMethod(Type[]) + 0x3ec
   at System.Linq.Expressions.Expression.ApplyTypeArgs(MethodInfo, Type[]) + 0xc7
   at System.Linq.Expressions.Expression.FindMethod(Type, String, Type[], Expression[], BindingFlags) + 0xe0
   at System.Linq.Expressions.Expression.Call(Expression, String, Type[], Expression[]) + 0xb4
   at Sparrow.Json.JsonDeserializationBase.GetValue(String, Type, ParameterExpression, Dictionary`2) + 0x757
   at Sparrow.Json.JsonDeserializationBase.GenerateJsonDeserializationRoutine[T]() + 0x9b6
   --- End of inner exception stack trace ---
   at Sparrow.Json.JsonDeserializationBase.<>c__DisplayClass3_0`1.<FailureBuildingJsonParser>b__0(BlittableJsonReaderObject) + 0xb8
   at Raven.Client.Documents.Commands.QueryCommand.SetResponse(JsonOperationContext, BlittableJsonReaderObject, Boolean) + 0xad
   at Raven.Client.Http.RavenCommand`1.<ProcessResponse>d__35.MoveNext() + 0x5b4
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x32
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xe5
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x86
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x2e
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() + 0x1a
   at Raven.Client.Http.RequestExecutor.<ExecuteAsync>d__92`1.MoveNext() + 0x2397
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x32
   at Raven.Client.Http.RequestExecutor.<ExecuteAsync>d__92`1.MoveNext() + 0x2a4a
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x32
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xe5
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x86
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x2e
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0x1a
   at Raven.Client.Util.AsyncHelpers.RunSync(Func`1) + 0xca
   at Raven.Client.Http.RequestExecutor.Execute[TResult](RavenCommand`1, JsonOperationContext, SessionInfo) + 0xb0
   at Raven.Client.Documents.Session.DocumentQuery`1.ExecuteActualQuery() + 0xca
   at Raven.Client.Documents.Session.DocumentQuery`1.InitSync() + 0xab
   at Raven.Client.Documents.Session.DocumentQuery`1.ExecuteQueryOperationInternal(Nullable`1) + 0xed
   at Raven.Client.Documents.Session.DocumentQuery`1.ExecuteQueryOperation(Nullable`1) + 0x2d
   at Raven.Client.Documents.Session.DocumentQuery`1.GetEnumerator() + 0x3a
   at System.Collections.Generic.List`1..ctor(IEnumerable`1) + 0x1b2
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1) + 0x7c
   at ArmaRavenDB.Database.DBSession.Fetch(String) + 0xb1
   at ArmaRavenDB.Database.DBSession.<>c__DisplayClass6_0.<BeginFetch>b__0() + 0x3a

These are the methods prototypes of the blittablejsonreaderobject:
Screenshot (11)_LI

@RUSshy

This comment has been minimized.

Copy link

@RUSshy RUSshy commented Nov 30, 2019

wrap the stacktrace inside two ``` to be more readable, not the quote one

System.InvalidOperationException: Could not build json parser for Raven.Client.Documents.Queries.QueryResult
---> EETypeRva:0x01BDCC10(System.Reflection.MissingRuntimeArtifactException): MakeGenericMethod() cannot create this generic method instantiation because the instantiation was not metadata-enabled: 'Sparrow.Json.BlittableJsonReaderObject.TryGet<System.Nullable<System.Int32>>(System.String,out System.Nullable<System.Int32>&)' For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616868
at Internal.Reflection.Core.Execution.ExecutionEnvironment.GetMethodInvoker(RuntimeTypeInfo, QMethodDefinition, RuntimeTypeInfo[], MemberInfo) + 0x273
at System.Reflection.Runtime.MethodInfos.NativeFormat.NativeFormatMethodCommon.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0xb6
at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x37 at System.Reflection.Runtime.MethodInfos.RuntimeConstructedGenericMethodInfo.get_UncachedMethodInvoker() + 0x3b at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.get_MethodInvoker() + 0x19c at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo1.MakeGenericMethod(Type[]) + 0x3ec
at System.Linq.Expressions.Expression.ApplyTypeArgs(MethodInfo, Type[]) + 0xc7
at System.Linq.Expressions.Expression.FindMethod(Type, String, Type[], Expression[], BindingFlags) + 0xe0
at System.Linq.Expressions.Expression.Call(Expression, String, Type[], Expression[]) + 0xb4
at Sparrow.Json.JsonDeserializationBase.GetValue(String, Type, ParameterExpression, Dictionary2) + 0x757 at Sparrow.Json.JsonDeserializationBase.GenerateJsonDeserializationRoutine[T]() + 0x9b6 --- End of inner exception stack trace --- at Sparrow.Json.JsonDeserializationBase.<>c__DisplayClass3_01.b__0(BlittableJsonReaderObject) + 0xb8
at Raven.Client.Documents.Commands.QueryCommand.SetResponse(JsonOperationContext, BlittableJsonReaderObject, Boolean) + 0xad
at Raven.Client.Http.RavenCommand1.<ProcessResponse>d__35.MoveNext() + 0x5b4 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x32 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xe5 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x86 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x2e at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() + 0x1a
at Raven.Client.Http.RequestExecutor.d__921.MoveNext() + 0x2397 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x32 at Raven.Client.Http.RequestExecutor.<ExecuteAsync>d__921.MoveNext() + 0x2a4a
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x32
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xe5
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x86
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x2e
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0x1a
at Raven.Client.Util.AsyncHelpers.RunSync(Func1) + 0xca at Raven.Client.Http.RequestExecutor.Execute[TResult](RavenCommand1, JsonOperationContext, SessionInfo) + 0xb0
at Raven.Client.Documents.Session.DocumentQuery1.ExecuteActualQuery() + 0xca at Raven.Client.Documents.Session.DocumentQuery1.InitSync() + 0xab
at Raven.Client.Documents.Session.DocumentQuery1.ExecuteQueryOperationInternal(Nullable1) + 0xed
at Raven.Client.Documents.Session.DocumentQuery1.ExecuteQueryOperation(Nullable1) + 0x2d
at Raven.Client.Documents.Session.DocumentQuery1.GetEnumerator() + 0x3a at System.Collections.Generic.List1..ctor(IEnumerable1) + 0x1b2 at System.Linq.Enumerable.ToList[TSource](IEnumerable1) + 0x7c
at ArmaRavenDB.Database.DBSession.Fetch(String) + 0xb1
at ArmaRavenDB.Database.DBSession.<>c__DisplayClass6_0.b__0() + 0x3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.