Intellij IDEA 2022,supermap-iobjectsjava-11.0.0-20828-94498-win-all,当使用SceneControl时候出现erroe,使用MapControl时正常运行
package com.java.Supermap;
import com.supermap.data.*;
import com.supermap.mapping.*;
import com.supermap.ui.*;
import com.supermap.ui.Action;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class BasicFunction01 extends JFrame{
public static void main(String[] args) {
JFrame frame=new JFrame();//创建一个窗体对象
JPanel jContentPane = new JPanel();//创建一个panel对象
frame.add(jContentPane);//把panel对象添加到窗体上
frame.setSize(500,800);//设置窗体的大小
frame.setVisible(true);//设置窗体的可见性
jContentPane.setSize(frame.getWidth(), frame.getHeight());//将panel的大小和窗体一致
Workspace workspace=new Workspace();//创建工作空间
WorkspaceConnectionInfo workspaceConnectionInfo=new WorkspaceConnectionInfo();//创建工作空间连接信息
workspaceConnectionInfo.setServer("D:\\SuperMap\\青羊\\20220525绘制.smwu");
workspaceConnectionInfo.setType(WorkspaceType.SMWU);//设置工作空间类型
workspace.open(workspaceConnectionInfo);//打开工作空间
MapControl mapControl=new MapControl();
jContentPane.add(mapControl,BorderLayout.CENTER);
mapControl.getMap().setWorkspace(workspace);
if (workspace.getMaps().getCount() <= 0) { //判断工作空间中是否有地图,如果有的话获取工作空间中的地图集
JOptionPane.showMessageDialog(jContentPane, "工作空间中没有地图");
return;
}
mapControl.getMap().open("Map");//通过名称打开工作空间中的地图
mapControl.setSize(jContentPane.getWidth(),jContentPane.getHeight());
mapControl.getMap().refresh();
// SceneControl sceneControl=new SceneControl();
// jContentPane.add(sceneControl,BorderLayout.CENTER);
// sceneControl.getScene().setWorkspace(workspace);
// if (workspace.getScenes().getCount() <= 0) {// 判断工作空间中是否有地图,如果有的话获取工作空间中的地图集
// JOptionPane.showMessageDialog(jContentPane, "工作空间中没有地图");
// return;
// }
// sceneControl.getScene().open("NetWork");//通过名称打开工作空间中的地图
// sceneControl.setSize(jContentPane.getWidth(),jContentPane.getHeight());
// sceneControl.getScene().refresh();
}
}
错误信息如下所示:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_UNCAUGHT_CXX_EXCEPTION (0xe06d7363) at pc=0x00007ffb7087474c, pid=11580, tid=12536
#
# JRE version: Java(TM) SE Runtime Environment (18.0.1.1+2) (build 18.0.1.1+2-6)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (18.0.1.1+2-6, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C [KERNELBASE.dll+0x4474c]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\Program Files\Solutions\Java\hs_err_pid11580.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Process finished with exit code 1
请问为什么会出现这个error,又该如何解决呢?
附日志文件:hs_err_pid11580.log链接:https://pan.baidu.com/s/1dLBuXOohk2i417QlVeQVsQ 提取码:mio9