C#调用java包,报错:“java.lang.StdIO”的类型初始值设定项引发异常

GGL123 GGL123 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
求救:
我在C#里调用java包,
引用到:
IKVM.OpenJDK.Core.dll
IKVM.Runtime.dll
IKVM.Runtime.JNI.dll
还有一个打包好的java包:WsRequestDemo.dll

但是在使用时跳出错误:“java.lang.StdIO”的类型初始值设定项引发异常

具体为:
未处理 System.TypeInitializationException
Message="“java.lang.StdIO”的类型初始值设定项引发异常。"
Source="IKVM.OpenJDK.Core"
TypeName="java.lang.StdIO"
StackTrace:
在 java.lang.System.get_out()
在 java.lang.Class$3.run()
在 java.lang.Class$3.run()
在 java.security.AccessController.doPrivileged(Object , AccessControlContext , CallerID )
在 java.security.AccessController.doPrivileged(PrivilegedAction action, CallerID )
在 java.lang.Class.checkInitted()
在 java.lang.Class.privateGetDeclaredConstructors(Boolean )
在 java.lang.Class.getConstructor0(Class[] , Int32 )
在 java.lang.Class.newInstance0(CallerID )
在 java.lang.Class.newInstance(CallerID )
在 sun.security.jca.ProviderConfig$2.run()
在 sun.security.jca.ProviderConfig$2.run()
在 java.security.AccessController.doPrivileged(Object , AccessControlContext , CallerID )
在 java.security.AccessController.doPrivileged(PrivilegedAction action, CallerID )
在 sun.security.jca.ProviderConfig.doLoadProvider()
在 sun.security.jca.ProviderConfig.getProvider()
在 sun.security.jca.ProviderList.getProvider(Int32 )
在 sun.security.jca.ProviderList.getService(String type, String name)
在 sun.security.jca.GetInstance.getInstance(String type, Class clazz, String algorithm)
在 java.security.Security.getImpl(String , String , String )
在 java.security.MessageDigest.getInstance(String algorithm)
在 com.zht.WsRequestDemo.getMessageDigest(String str1, String str2)
在 WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) 位置 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:行号 28
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 WindowsFormsApplication1.Program.Main() 位置 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\projects\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:行号 18
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.FileNotFoundException
Message="未能加载文件或程序集“IKVM.OpenJDK.Util, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58”或它的某一个依赖项。系统找不到指定的文件。"
Source="IKVM.OpenJDK.Core"
FileName="IKVM.OpenJDK.Util, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58"
FusionLog="=== 预绑定状态信息 ===\r\n日志: 用户 = VSTFS\\Administrator\r\n日志: DisplayName = IKVM.OpenJDK.Util, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58\n (Fully-specified)\r\n日志: Appbase = file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio 2008/projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/\r\n日志: 初始 PrivatePath = NULL\r\n调用程序集: IKVM.OpenJDK.Core, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58。\r\n===\r\n日志: 此绑定从 default 加载上下文开始。\r\n日志: 未找到应用程序配置文件。\r\n日志: 使用 C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\config\\machine.config 的计算机配置文件。\r\n日志: 策略后引用: IKVM.OpenJDK.Util, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58\r\n日志: 相同的绑定已出现过,因 hr = 0x80070002 而失败。\r\n"
StackTrace:
在 sun.misc.URLClassPath.JarLoader.ensureOpen()
在 sun.misc.URLClassPath.JarLoader..ctor(URL , URLStreamHandler , HashMap )
在 sun.misc.URLClassPath$3.run()
在 sun.misc.URLClassPath$3.run()
在 java.security.AccessController.doPrivileged(Object , AccessControlContext , CallerID )
在 java.security.AccessController.doPrivileged(PrivilegedExceptionAction action, CallerID )
在 sun.misc.URLClassPath.getLoader(URL )
在 sun.misc.URLClassPath.getLoader(Int32 )
在 sun.misc.URLClassPath.access$000(URLClassPath , Int32 )
在 sun.misc.URLClassPath$1.next()
在 sun.misc.URLClassPath$1.hasMoreElements()
在 IKVM.Internal.AssemblyClassLoader.<GetResourcesImpl>d__0.MoveNext()
在 IKVM.Internal.AssemblyClassLoader.<GetResourcesImpl>d__0.MoveNext()
在 IKVM.NativeCode.ikvm.runtime.AssemblyClassLoader.getResources(ClassLoader classLoader, Assembly assembly, String name)
在 ikvm.runtime.AssemblyClassLoader.getResources(ClassLoader , Assembly , String )
在 ikvm.runtime.AssemblyClassLoader.getResources(String name)
在 java.util.ServiceLoader.LazyIterator.hasNext()
在 java.util.ServiceLoader$1.hasNext()
在 java.nio.charset.Charset$1.getNext()
在 java.nio.charset.Charset$1.hasNext()
在 java.nio.charset.Charset$2.run()
在 java.nio.charset.Charset$2.run()
在 java.security.AccessController.doPrivileged(Object , AccessControlContext , CallerID )
在 java.security.AccessController.doPrivileged(PrivilegedAction action, CallerID )
在 java.nio.charset.Charset.lookupViaProviders(String )
在 java.nio.charset.Charset.lookup2(String )
在 java.nio.charset.Charset.lookup(String )
在 java.nio.charset.Charset.defaultCharset()
在 sun.nio.cs.StreamEncoder.forOutputStreamWriter(OutputStream out, Object lock, String charsetName)
在 java.io.OutputStreamWriter..ctor(OutputStream out)
在 java.io.PrintStream..ctor(Boolean , OutputStream )
在 java.io.PrintStream..ctor(OutputStream out, Boolean autoFlush)
在 java.lang.StdIO..cctor()
InnerException:


...全文

相关推荐

【深度学习预测】项目介绍 Python实现基于BO-Transformer-LSTM贝叶斯优化算法(BO)优化Transformer-LSTM模型进行多变量时间序列预测(含模型描述及部分示例代码)

内容概要:本文详细介绍了一个基于BO-Transformer-LSTM的多变量时间序列预测项目,通过结合Transformer的全局自注意力机制与LSTM的局部时序建模能力,构建了适用于复杂业务场景的深度学习预测模型。模型输入采用多变量滑动窗口结构,并引入正弦余弦位置编码以保留时间顺序信息;Transformer编码器提取变量间长距离依赖关系,LSTM进一步捕捉动态演化特征,最终通过回归层输出预测值。为优化模型性能,采用贝叶斯优化算法(基于Tree-structured Parzen Estimator)自动搜索最优超参数组合,包括嵌入维度、注意力头数、学习率、窗口长度等,显著提升了调参效率与模型泛化能力。项目还设计了包含周期性、趋势性、均值回归、突发事件和异方差噪声的五因素模拟数据生成机制,确保数据贴近真实业务场景,并建立了从数据预处理、模型训练、验证评估到结果恢复的完整技术链路。; 适合人群:具备一定机器学习与深度学习基础,熟悉PyTorch框架,从事时间序列预测相关研究或工程应用的研发人员、数据科学家及研究生。; 使用场景及目标:①应用于能源负荷预测、设备状态监测、金融风控、供应链需求预测等多变量时间序列预测任务;②解决传统模型在长时依赖、非线性关系和高维特征下的预测瓶颈;③实现高效超参数优化,提升模型调优自动化水平与部署可行性。; 阅读建议:本文含核心模型结构与部分示例代码,建议结合完整项目代码(如GitHub或博客资源)进行复现实践,重点关注数据生成逻辑、模型前向传播流程及贝叶斯优化集成方式,同时可通过调整网络结构或优化策略进一步拓展至多步预测、概率输出与可视化分析等高级功能。

nantangyuxi

城市生命线之长距离输水管线的监测与检测.pdf

城市生命线之长距离输水管线的监测与检测.pdf

公众号:优享智库

复现水下航行器(NMPC)非线性模型预测控制分布式轨迹跟踪(Matlab代码实现)

内容概要:本文档围绕水下航行器(AUV)的非线性模型预测控制(NMPC)分布式轨迹跟踪技术展开,重点复现并实现了国际顶级期刊中提出的先进控制算法。该资源详细提供了基于Matlab的仿真代码,涵盖AUV的非线性动力学建模、多智能体系统协同控制、事件触发通信机制以及复杂海洋环境下分布式轨迹跟踪的优化求解过程。通过系统地构建NMPC控制器,实现对预设轨迹的高精度跟踪,同时有效处理系统约束与外部扰动。研究强调算法在多AUV协同任务中的适用性,突出其在节能通信与实时性方面的优势,是控制理论与工程实践相结合的典型范例; 适合人群:具备自动控制原理、非线性系统理论及Matlab编程基础的研究生、科研人员和工程技术开发者,尤其适用于从事水下机器人、智能控制、多智能体协同、路径规划与优化控制等方向的研究者; 使用场景及目标:① 深入理解非线性模型预测控制(NMPC)在欠驱动AUV轨迹跟踪中的设计与实现机制;② 复现并验证高水平学术论文中的控制策略,支撑科研创新与论文撰写;③ 探索事件触发机制下的分布式协同控制架构,提升多智能体系统的通信效率与控制性能; 阅读建议:建议结合现代控制理论相关教材与原始参考文献,逐行分析Matlab代码结构与算法流程,重点关注系统建模、代价函数构造、约束处理与优化求解器的调用方式。可通过调整控制参数、初始状态或引入环境干扰等方式进行仿真实验,以评估算法的鲁棒性、收敛性与工程实用性。

天天程序猿

AI大模型训练大规模智算中心建设方案.pdf

AI大模型训练大规模智算中心建设方案.pdf

公众号:优享智库

西周BC798年世界历史地图矢量文件SHP格式.zip

本资源为《西周BC798年世界历史地图矢量文件SHP格式》压缩包,文件大小约 24.84 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

白水先森
评论 6
收藏 已收藏
分享
返回顶部
GGL123
C# 111,130 成员 642,541 内容