gpt4 book ai didi

java - jni4net - System.Runtime.Remoting.RemotingException

转载 作者:太空宇宙 更新时间:2023-11-03 16:10:37 25 4
gpt4 key购买 nike

我正在尝试使用 Java/.NET 桥接器与服务器通信。这座桥是用jni4net build 的并且似乎有效(到目前为止)。

  public static void main(String[] args) {
File sibDll = new File("SibKernel.Client.j4n.dll");

Bridge.setVerbose(true);
Bridge.setClrVersion("v20");

try {
Bridge.init();

Bridge.LoadAndRegisterAssemblyFrom(sibDll);

} catch (IOException e) {
e.printStackTrace();
}

if (SibKernelHelper.isConfigured() == false) {
SibKernelHelper.Configure();
}

IMasterBoardManager mstrBoardMngr = SibKernelHelper.GetMasterBoardManager();
}

我真的不知道问题出在哪里。有没有人遇到过这样的问题?

这是完整的异常堆栈跟踪:

Exception in thread "main" System.Runtime.Remoting.RemotingException: Cannot load type 'net.sf.jni4net.jni.IJvmProxy, jni4net.n-0.8.6.0, Version=0.8.6.0, Culture=neutral, PublicKeyToken=134a23405600bab4'.

Server stack trace:
at System.Runtime.Remoting.Messaging.MethodCall.ResolveMethod(Boolean bThrowIfNotResolved)
at System.Runtime.Remoting.Messaging.MethodCall..ctor(Object handlerObject, BinaryMethodCallMessage smuggledMsg)
at System.Runtime.Serialization.Formatters.Binary.BinaryMethodCall.ReadArray(Object[] callA, Object handlerObject)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at net.sf.jni4net.jni.IJvmProxy.get_JvmHandle()
at net.sf.jni4net.utils.Convertor.FullC2J[TBoth](JNIEnv env, TBoth obj)
at SibKernel.Client.__SibKernelHelper.GetMasterBoardManager6(IntPtr __envp, JniLocalHandle __class)
at sibkernel.client.SibKernelHelper.GetMasterBoardManager(Native Method)
at client.SIBClient.main(SIBClient.java:28)

最佳答案

您似乎正在尝试实例化某些继承或依赖于 jni4net 的类型,但问题发生在您的 .NET 远程处理的另一端。可能您将 Java 对象的实例作为远程调用的参数传递。

关于java - jni4net - System.Runtime.Remoting.RemotingException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17597645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com