首页 / 浏览问题 / 组件GIS / 问题详情
iobject导入shp文件jvm崩溃
8EXP 2019年05月15日
系统是win10
jar包用的是iserver中的iobjectjava下的jar包
运行到这就崩溃
DataImport importer = new DataImport();
importer.run();

# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000000000b, pid=11896, tid=0x000000000000274c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_211-b12) (build 1.8.0_211-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.211-b12 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  0x000000000000000b
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Program Files\apache-tomcat-8.5.40\bin\hs_err_pid11896.log
#
# If you would like to submit a bug report, please visit:
#   http://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.
#
Disconnected from the target VM, address: '127.0.0.1:9139', transport: 'socket'
Disconnected from server

1个回答

你好,你在导入的时候有设置导入的参数设置吗?需要写dataImport.getImportSettings().add(importSettingSHP);检查一下你导入的参数是否都设置正确
9,192EXP 2019年05月15日
直接创建的这个
ImportSettingSHP importSetting = new ImportSettingSHP();
importer.getImportSettings().add(importSetting);
你能否把你的关键代码截出来。这边看一下你的代码是否有问题
public static boolean importData(String shpfile, String dsname, String dtname, String ImportType) {
boolean boo = false;
Workspace workspace = null;
Datasource yztDs = null;      // 临时数据源
try {
   workspace = SmBasicClass.workspace;
   // 临时数据源
   yztDs = DataSourceFunction.getDataSource(workspace, dsname);
   // 创建临时分析数据集
   DatasetVector rDv = null;
   if (dsname.toUpperCase().equals("YZT")) {
      rDv = DatasetFunction.getNewVector(yztDs, dtname, DatasetType.REGION);
   }else {
      try {
         rDv = (DatasetVector) yztDs.getDatasets().get(dtname);
      } catch (Exception e) {
         logger.error("数据集 " + dtname + " 获取失败");
      }
      
   }
   rDv.setPrjCoordSys(SmBasicClass.mapBase.getPrjCoordSys().clone());
   CommonFunction.PrintInfo("创建完成临时分析数据集");
   
   logger.info("shp路径:" + shpfile);
   logger.info("目标数据源:" + dsname + ",目标数据集:" + dtname);
   logger.info("开始导入...");
   // 导入到指定的数据源数据集中
   ImportSettingSHP importSetting = new ImportSettingSHP();
   importSetting.setAttributeIgnored(false);
   if (ImportType.equals("1")) {
      // 1表示追加
      importSetting.setImportMode(ImportMode.APPEND);
   } else if (ImportType.equals("2")) {
      // 2表示覆盖
      importSetting.setImportMode(ImportMode.OVERWRITE);
   }
   importSetting.setSourceFilePath(shpfile);
   importSetting.setSourceFileCharset(Charset.UTF8);
   importSetting.setTargetDatasource(yztDs);
   importSetting.setTargetDatasetName(dtname);
   DataImport importer = new DataImport();
   importer.getImportSettings().add(importSetting);
   importer.run();

   // 释放对象
   importSetting.dispose();
   importer.dispose();
   
   logger.info("入库完毕" + shpfile);
   boo = true;
} catch (Exception e) {
   logger.error(e.getMessage());
   boo = false;
}

}

这一块可以吗

这样,你加我一个qq,把崩溃日志发给我一下。联系方式私信你
...