首页 / 浏览问题 / 组件GIS / 问题详情
插件开发时无法添加数据源无法新建场景
6EXP 2022年05月26日
iDesktopX 11i插件开发报错java.lang.UnsatisfiedLinkError: com.supermap.ui.SceneControlNative.jni_New(Ljava/awt/Component;I)J

使用产品:iobjectsjava(对应iDesktop 11i)

操作系统 :win11 x64

开发工具:IDEA

java版本:java8(jdk1.8)

问题描述:

用SuperMap iDesktopX 11i进行插件开发。用我的程序启动超图桌面端后,无论新建数据源还是新建场景程序都会报错(不过新建数据源的话不会卡住,能完成,新建场景卡一会儿后就没反应)。报错如下:

SmUncaughtExceptionHandler.uncaughtException(SourceFile:12)   -

java.lang.UnsatisfiedLinkError: com.supermap.ui.SceneControlNative.jni_New(Ljava/awt/Component;I)J

       at com.supermap.ui.SceneControlNative.jni_New(Native Method)

       at com.supermap.ui.SceneControl.makeSureNewFromJNI(SourceFile:958)

       at com.supermap.ui.SceneControl.getScene(SourceFile:610)

       at com.supermap.desktop.realspaceview.FormScene.lambda$new$6(SourceFile:568)

       at com.supermap.desktop.core.event.FormEventHelper.fireFormShown(SourceFile:137)

       at com.supermap.desktop.controls.ui.FormBaseChild.fireFormShown(SourceFile:419)

       at com.supermap.desktop.controls.ui.FormManager.lambda$new$1(SourceFile:128)

       at com.supermap.desktop.controls.ui.mdi.MdiEventsHelper.a(SourceFile:80)

       at com.supermap.desktop.controls.ui.mdi.MdiPane$MdiGroupHandler.pageAdded(SourceFile:521)

       at com.supermap.desktop.controls.ui.mdi.MdiEventsHelper.a(SourceFile:80)

       at com.supermap.desktop.controls.ui.mdi.MdiGroup.addPage(SourceFile:218)

       at com.supermap.desktop.controls.ui.mdi.MdiPane.addPage(SourceFile:248)

       at com.supermap.desktop.controls.ui.FormManager.add(SourceFile:229)

       at com.supermap.desktop.controls.ui.FormManager.add(SourceFile:211)

       at com.supermap.desktop.controls.ui.FormManager.setActiveForm(SourceFile:298)

      at com.supermap.desktop.realspaceview.RealspaceViewPlugin.showScene(SourceFile:99)

       at com.supermap.desktop.realspaceview.RealspaceViewPlugin.a(SourceFile:67)

       at com.supermap.desktop.core.utilties.FormUtilities.a(SourceFile:221)

       at com.supermap.desktop.core.utilties.FormUtilities.fireNewWindowEvent(SourceFile:148)

       at com.supermap.desktop.core.utilties.FormUtilities.fireNewWindowEvent(SourceFile:133)

       at com.supermap.desktop.realspaceview.ctrlAction.CtrlActionNewSceneFlat.run(SourceFile:21)

       at com.supermap.desktop.core.implement.CtrlActionDummy.run(SourceFile:181)

       at com.supermap.desktop.core.implement.CtrlAction.doRun(SourceFile:88)

       at com.supermap.desktop.core.implement.SmCommandMenuButton.item_ActionPerformed(SourceFile:92)

       at com.supermap.desktop.core.implement.SmCommandMenuButton.lambda$init$2(SourceFile:65)

       at org.pushingpixels.flamingo.api.common.AbstractCommandButton.fireActionPerformed(SourceFile:273)

       at org.pushingpixels.flamingo.api.common.AbstractCommandButton$ActionHandler.actionPerformed(SourceFile:249)

       at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

       at org.pushingpixels.flamingo.api.common.model.ActionRepeatableButtonModel.setPressed(SourceFile:59)

       at org.pushingpixels.flamingo.internal.ui.common.BasicCommandButtonListener.mouseReleased(SourceFile:89)

       at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

       at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

       at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

另外在启动程序的时候,会报错:

java.lang.UnsatisfiedLinkError: D:\SuperMap\SuperMap iDesktopX 11i\bin\WrapjRealspace.dll: Can't find dependent libraries

       at java.lang.ClassLoader$NativeLibrary.load(Native Method)

       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)

       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1853)

       at java.lang.Runtime.loadLibrary0(Runtime.java:871)

       at java.lang.System.loadLibrary(System.java:1122)

       at com.supermap.data.Environment.a(SourceFile:459)

       at com.supermap.data.Environment.LoadWrapJ(SourceFile:432)

       at com.supermap.data.Environment.<clinit>(SourceFile:35)

       at com.supermap.data.InternalHandle.<clinit>(SourceFile:19)

       at com.supermap.desktop.core.GlobalParameters.<clinit>(SourceFile:1179)

       at com.supermap.desktop.core.Application.initialize(SourceFile:336)

       at iMapEx.CadastralTool.PluginStartUp.main(PluginStartUp.java:7)

其他信息:

1、以前都没有这些问题。这几天在写关于GeoModel3D的代码,然后就频繁报错。

2、path环境变量已经设置为SuperMap iDesktopX 11i\bin目录了,且在最前面。

3、许可没问题。

4、后面重装java、重装supermap都没用。

请教一下,主要原因到底在哪里?

1个回答

您好,根据您的报错信息来看,是 WrapjRealspace.dll 的依赖存在问题,导致后续关于三维场景的相关操作都存在异常。建议您通过 Dependency Walker 依赖检查工具检查一下 WrapjRealspace.dll 的哪些依赖存在异常或者丢失。

估计出问题的依赖是当前系统底层的某个库,不是当前 SuperMap iDesktopX 安装包中的DLL库,所以重新安装 SuperMap iDesktopX 11i 也没有用。

希望可以帮到您。

2,158EXP 2022年05月26日

您好,报错的dll太多了,包括系统dll和SuperMap自己的dll,比如图中这些。需要重新下载这些supermap的dll?

是的,先替换SuperMap抛异常的DLL,如果SuperMap的DLL都不再抛异常后,运行还是抛上面的异常的话,再尝试修复系统的那些异常DLL,直到程序运行时不再抛环境异常。
能问下具体是啥原因引起的这种情况吗?按理说不应该啊。

另,准备重装系统了。刚才把SuperMap的dll都替换了,还是一样的错,系统的dll得有上百个了。
您好,这个可能有多个原因造成系统的部分dll存在异常,如:电脑中病毒、不小心误删了某个东西、安装什么盗版软件导致系统底层的某些依赖库存在问题、系统更新时异常退出导致某些底层依赖库出异常等。系统底层依赖库出问题后确实很难处理。
您好,现在彻底搞不懂什么原因了。今天重置了系统,SuperMap  java  IDEA等都是重新下载的。这次我打开的是SuperMap自带的SampleCode程序,结果还是报一模一样的错。(初始化时报WrapjRealspace.dll的错,新建球面场景时也报错,添加数据源不会报错了)。

可否远程帮助一下?
如果是单独启动SuperMap,任何操作都没问题。
您添加我的联系方式(QQ:153895208)吧,我远程帮您看看
多谢!我刚已解决,是java版本的问题。之前用的是java 1.8.0_333,换成openjdk8u322后,就没问题了!
...