首页 / 浏览问题 / 其他 / 问题详情
iobject java 拓扑 运行时jvm崩溃
1EXP 2019年01月14日
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000001fe0fc7d, pid=8652, tid=0x00000000000023a4
#
# JRE version: Java(TM) SE Runtime Environment (8.0_102-b14) (build 1.8.0_102-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.102-b14 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [SuEngine.dll+0xcfc7d]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# 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.
#

---------------  T H R E A D  ---------------

Current thread (0x0000000015f8a000):  JavaThread "Finalizer" daemon [_thread_in_native, id=9124, stack(0x0000000017170000,0x00000000171f0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0xffffffffffffffff

Registers:
RAX=0x00007ffcb9d7fa80, RBX=0x0000000039f5ea70, RCX=0x405d9463a225ca15, RDX=0x00000000171ef1f8
RSP=0x00000000171ef110, RBP=0x00000000171ef1e8, RSI=0x000000002a73cc58, RDI=0x0000000000000248
R8 =0x0000000039f5ea70, R9 =0x00000000114f0000, R10=0x0000000002647f28, R11=0x00000000612ab330
R12=0x0000000000000000, R13=0x000000002a72b0b0, R14=0x00000000171ef210, R15=0x0000000015f8a000
RIP=0x000000001fe0fc7d, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x00000000171ef110)
0x00000000171ef110:   000000000000b789 19ab39ad00000000
0x00000000171ef120:   00000000e7599d40 0000000000000000
0x00000000171ef130:   0000000039f5ea70 00007ffcb9d7fa9b
0x00000000171ef140:   00000000e778fd58 00000000a02e6398
0x00000000171ef150:   00000000a02e6368 00000000021c5ce0
0x00000000171ef160:   000000002a72b0b0 0000000002647f54
0x00000000171ef170:   0000000000000248 00000000320ad260
0x00000000171ef180:   00000000171ef2d8 0000000002cacaac
0x00000000171ef190:   0000000015f8a000 00000000171ef280
0x00000000171ef1a0:   00000000171ef380 00000000171ef1a8
0x00000000171ef1b0:   0000000000000000 00000000171ef210
0x00000000171ef1c0:   000000002a72daa8 0000000000000000
0x00000000171ef1d0:   000000002a72b0b0 0000000000000000
0x00000000171ef1e0:   00000000171ef208 00000000171ef258
0x00000000171ef1f0:   000000000263835d 00000000e7565890
0x00000000171ef200:   00000000026419d8 0000000039f5ea70

Instructions: (pc=0x000000001fe0fc7d)
0x000000001fe0fc5d:   48 83 c4 30 5f c3 cc cc cc cc cc cc cc cc cc cc
0x000000001fe0fc6d:   cc cc cc 40 53 48 83 ec 20 48 8b d9 48 8b 49 30
0x000000001fe0fc7d:   48 8b 01 ff 50 18 3d 9c 00 00 00 74 0a 48 8b 43
0x000000001fe0fc8d:   30 48 83 c4 20 5b c3 33 c0 48 83 c4 20 5b c3 cc

Register to memory mapping:

RAX=0x00007ffcb9d7fa80 is an unknown value
RBX=0x0000000039f5ea70 is an unknown value
RCX=0x405d9463a225ca15 is an unknown value
RDX=0x00000000171ef1f8 is pointing into the stack for thread: 0x0000000015f8a000
RSP=0x00000000171ef110 is pointing into the stack for thread: 0x0000000015f8a000
RBP=0x00000000171ef1e8 is pointing into the stack for thread: 0x0000000015f8a000
RSI=0x000000002a73cc58 is pointing into metadata
RDI=0x0000000000000248 is an unknown value
R8 =0x0000000039f5ea70 is an unknown value
R9 =0x00000000114f0000 is an unknown value
R10=0x0000000002647f28 is at code_begin+840 in an Interpreter codelet
method entry point (kind = native)  [0x0000000002647be0, 0x0000000002648540]  2400 bytes
R11=0x00000000612ab330 is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x000000002a72b0b8} 'jni_Close' '(J)V' in 'com/supermap/data/RecordsetNative'
R14=0x00000000171ef210 is pointing into the stack for thread: 0x0000000015f8a000
R15=0x0000000015f8a000 is a thread

Stack: [0x0000000017170000,0x00000000171f0000],  sp=0x00000000171ef110,  free space=508k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [SuEngine.dll+0xcfc7d]
C  [WrapjEngine.dll+0x2fa9b]
C  0x0000000002647f54

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.supermap.data.RecordsetNative.jni_Close(J)V+0
j  com.supermap.data.Recordset.close()V+11
j  com.supermap.data.Recordset.dispose()V+39
J 2886 C2 com.supermap.data.InternalHandleDisposable.finalize()V (21 bytes) @ 0x0000000002d63b1c [0x0000000002d63ac0+0x5c]
J 2876 C2 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x0000000002b64200 [0x0000000002b64040+0x1c0]
j  java.lang.ref.Finalizer$FinalizerThread.run()V+45
v  ~StubRoutines::call_stub

1个回答

你好,你是使用的拓扑检查还是拓扑处理,麻烦说一下具体使用的是哪个类中哪个方法。调试一下是运行到哪句代码报的异常
9,232EXP 2019年01月14日
finally {
            if(recordsetB != null) {
                logger.debug("数据集B 开始释放");
                recordsetB.close();
                recordsetB.dispose();
                logger.debug("数据集B 释放完毕");
            }
            if(recordsetA != null) {
                logger.debug("数据集A 开始释放");
                recordsetA.close();
                recordsetA.dispose();
                logger.debug("数据集A 释放完毕");
            }
            if(recordset != null) {
                logger.debug("数据集 开始释放");
                recordset.close();
                recordset.dispose();
                logger.debug("数据集 释放完毕");
            }
            if(datasources != null) {
                logger.debug("数据源集合 开始释放");
                datasources.closeAll();
                logger.debug("数据源集合 释放完毕");
            }
            if (workspace != null) {
                logger.debug("工作空间 开始释放");
                workspace.dispose();
                logger.debug("工作空间 释放完毕");
            }
        }

这是我资源释放的代码,帮忙看一下吧
com.supermap.analyst.spatialanalyst.OverlayAnalyst
intersect(DatasetVector dataset, DatasetVector intersectDataset, DatasetVector resultDataset, OverlayAnalystParameter parameter)
          进行相交方式的叠加分析,将被相交叠加分析的数据集中不包含在用来相交叠加分析的数据集中的对象切割并删除。

是系统级错误,堆栈溢出,代码运行都没有错,但是运行几次之后tomcat直接崩溃,bin下产生一个错误日志就是上面的

Stack: [0x0000000017170000,0x00000000171f0000],  sp=0x00000000171ef110,  free space=508k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [SuEngine.dll+0xcfc7d]
C  [WrapjEngine.dll+0x2fa9b]
C  0x0000000002647f54

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.supermap.data.RecordsetNative.jni_Close(J)V+0
j  com.supermap.data.Recordset.close()V+11
j  com.supermap.data.Recordset.dispose()V+39
J 2886 C2 com.supermap.data.InternalHandleDisposable.finalize()V (21 bytes) @ 0x0000000002d63b1c [0x0000000002d63ac0+0x5c]
J 2876 C2 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x0000000002b64200 [0x0000000002b64040+0x1c0]
j  java.lang.ref.Finalizer$FinalizerThread.run()V+45
v  ~StubRoutines::call_stub

不知道怎么回事,是我资源释放的问题吗

你是开发的web程序?检查一下你开发平台使用的jdk路径与你本机的jdk路径是否一致,然后重新编译一下程序。
开发平台的jdk和本机路径不一致,但是jdk版本一致。即使在eclipse上运行也会崩溃。重新编译依然崩溃。
把你工程文件贴出来看一下吧,这边测试一下
就是这些了,objectjava 8.1版本 jdk1.7  Tomcat 8.5,方便的话可以留个联系方式吗,方便交流,这个工程我也可以直接发给您
@ResponseBody
    @RequestMapping({ "/topologyAnalyse" })
    public Object topologyAnalyse(HttpServletRequest request, HttpServletResponse response)
            throws UnsupportedEncodingException {
        Map<String, Object> resultMap = new HashMap<String, Object> ();
        boolean istrue = false;

        Workspace workspace = null;
        DatasetVector resultDatasetIntersect = null;
        Datasources datasources = null;
        Datasource targetDatasource = null;
        Recordset recordset = null;
        Recordset recordsetA = null;
        Recordset recordsetB = null;
        try {
            String datasetNameA = URLDecoder.decode(request.getParameter("datasetNameA"), "UTF-8");
            String datasetNameB = URLDecoder.decode(request.getParameter("datasetNameB"), "UTF-8");
            System.out.println("datasetNameA=" + datasetNameA);
            System.out.println("datasetNameB=" + datasetNameB);
            workspace = new Workspace();
            DatasourceConnectionInfo datasourceConnectionInfo = DatasourceUtils
                    .getDatasourceConnectionInfo(datasourceMap);
            datasources = workspace.getDatasources();
            targetDatasource = datasources.open(datasourceConnectionInfo);
            if(targetDatasource.getDatasets().contains(datasetNameA) == false) {
                resultMap.put("code", Integer.valueOf(1));
                resultMap.put("message", datasetNameA + "不存在该数据集,请检查数据源");
                return resultMap;
            }
            if(targetDatasource.getDatasets().contains(datasetNameB) == false) {
                resultMap.put("code", Integer.valueOf(1));
                resultMap.put("message", datasetNameB + "不存在该数据集,请检查数据源");
                return resultMap;
            }
            
            
            DatasetVector datasetIntersected = (DatasetVector) targetDatasource.getDatasets().get(datasetNameA);
            DatasetVector datasetIntersect = (DatasetVector) targetDatasource.getDatasets().get(datasetNameB);
            System.out.println("datasetIntersected,datasetIntersect 获取成功");
            if ((!"REGION".equals(datasetIntersected.getType().name()))
                    || (!"REGION".equals(datasetIntersect.getType().name()))) {
                resultMap.put("code", Integer.valueOf(1));
                resultMap.put("message", "请选择面数据");
                return resultMap;
            }
            boolean isExist = targetDatasource.getDatasets().contains("topoReault");
            if (isExist) {
                System.out.println("删除topoReault");
                resultDatasetIntersect = (DatasetVector) targetDatasource.getDatasets().get("topoReault");
                while (resultDatasetIntersect.getRecordCount() > 0) {
                    resultDatasetIntersect.getRecordset(false, CursorType.DYNAMIC).deleteAll();
                }
            } else {
                System.out.println("创建topoReault");

                DatasetVectorInfo datasetvectorInfoIntersect = new DatasetVectorInfo();
                datasetvectorInfoIntersect.setType(DatasetType.REGION);
                datasetvectorInfoIntersect.setName("topoReault");
                datasetvectorInfoIntersect.setEncodeType(EncodeType.NONE);
                resultDatasetIntersect = targetDatasource.getDatasets().create(datasetvectorInfoIntersect);
            }
            OverlayAnalystParameter overlayAnalystParamIntersect = new OverlayAnalystParameter();
            
            recordsetA = datasetIntersected.getRecordset(false, CursorType.STATIC);
            recordsetB = datasetIntersect.getRecordset(false, CursorType.STATIC);

            String fieldsA[] = (String[]) getInfoFromRecordset(recordsetA).get("fields");
            String fieldsB[] = (String[]) getInfoFromRecordset(recordsetB).get("fields");
            
            List<String> fieldsAList = new ArrayList<String>();
            for(String item : fieldsA) {
                if(checkname(item)) {
                    fieldsAList.add(item);
                }
            }
            List<String> fieldsBList = new ArrayList<String>();
            for(String item : fieldsB) {
                if(checkname(item)) {
                    fieldsBList.add(item);
                }
            }
            
            overlayAnalystParamIntersect.setSourceRetainedFields(fieldsAList.toArray(new String[fieldsAList.size()]));
            overlayAnalystParamIntersect.setOperationRetainedFields(fieldsBList.toArray(new String[fieldsBList.size()]));
            
            overlayAnalystParamIntersect.setTolerance(1.1074E-6D);
            System.out.println("开始分析");

            istrue = OverlayAnalyst.intersect(datasetIntersected, datasetIntersect, resultDatasetIntersect,
                    overlayAnalystParamIntersect);
            System.out.println("分析结束");
            if (istrue) {
                java.util.Map<Integer, Feature> featuresMap = resultDatasetIntersect.getAllFeatures();
                //List<Feature> featuresList = new ArrayList<Feature>();
                //List<GeoJsonFeatureGeometry> geomtryList = new ArrayList<GeoJsonFeatureGeometry>();
                List<GeoJsonFeature> geofeatureList = new ArrayList<GeoJsonFeature>();
                Double featureArea = 0.0;
                recordset = resultDatasetIntersect.getRecordset(false, CursorType.STATIC);
                Map<String, Object> dataFromRecordset = getInfoFromRecordset(recordset);
                
                for (Feature feature : featuresMap.values()) {
                    GeoJsonFeatureGeometry geometry = geometryFormatGeoJsonFeatureGeometry(feature.getGeometry());
                    GeoJsonFeature geoFeature =  featureFormatGeoJsonFeature(feature,dataFromRecordset,geometry);
                    geofeatureList.add(geoFeature);
                    featureArea += geometry.getArea();
                }
                
                
                Map<String,Object> resultDataMap = new HashMap<String,Object>();
                
                resultDataMap.put("features", geofeatureList);
                resultDataMap.put("area", featureArea * Math.pow(10, 8));
                resultMap.put("code", Integer.valueOf(0));
                resultMap.put("data", resultDataMap);
            } else {
                resultMap.put("code", Integer.valueOf(1));
                resultMap.put("message", "拓扑分析失败");
            }
            return resultMap;
        } catch (Exception e) {
            e.printStackTrace();
            resultMap.put("code", Integer.valueOf(-1));
            resultMap.put("message", e.toString());
            return resultMap;
        } finally {
            if(recordsetB != null) {
                logger.debug("数据集B 开始释放");
                recordsetB.close();
                recordsetB.dispose();
                logger.debug("数据集B 释放完毕");
            }
            if(recordsetA != null) {
                logger.debug("数据集A 开始释放");
                recordsetA.close();
                recordsetA.dispose();
                logger.debug("数据集A 释放完毕");
            }
            if(recordset != null) {
                logger.debug("数据集 开始释放");
                recordset.close();
                recordset.dispose();
                logger.debug("数据集 释放完毕");
            }
            if(datasources != null) {
                logger.debug("数据源集合 开始释放");
                datasources.closeAll();
                logger.debug("数据源集合 释放完毕");
            }
            if (workspace != null) {
                logger.debug("工作空间 开始释放");
                workspace.dispose();
                logger.debug("工作空间 释放完毕");
            }
        }
    }
qq私信你了
没有收到呀,方便的话在发一条吧
...