java 场景缓存生成失败 [已关闭]

0 投票

在本地可以运行生成,在其他一台电脑上,构建缓存报错。这跟环境什么的有关系吗? 这是什么原因导致的?

    private Boolean SceneCacheBuild(Scene scene,Path output,String workspaceName) {
        Boolean flag = false;
        SceneCacheBuilder builder = null;
        try {
            //1.三维数据集图层设置
            Layer3Ds layer3Ds = scene.getLayers();
            System.out.println("场景中图层数量:"+layer3Ds.getCount());
            ArrayList<String> layerNames = new ArrayList<String>();
            for(int i=0;i<layer3Ds.getCount();i++) {
                Layer3D layer3D = layer3Ds.get(i);
                if(layer3D.getType()==Layer3DType.DATASET)
                {
                    Layer3DDataset layer3DDataset = (Layer3DDataset)layer3D;
                    layer3DDataset.setFileType(CacheFileType.S3M);//缓存文件类型
                    layer3DDataset.setTileWidth(2000);//瓦片宽度
                    layer3DDataset.setIsBuildOSGBCache(true);//三维切片缓存,不然会生成矢量缓存
                    layer3DDataset.setBuildOSGBPipeCache(true);//生成管线缓存
                    layer3DDataset.setFilterPixelSize(2);//像素过滤值,提升显示性能
                    layer3DDataset.setLODCount(0);//部分管点符号模型存在压缩变形,这个参数是超图给出的解决方式
                    layerNames.add(layer3D.getName());
                }
            }
            System.out.println("场景中三维自定义专题图层数量:"+layerNames.size());
            if(layerNames.size()==0)
            {
                return false;
            }
            //2.场景缓存生成参数
            builder = new SceneCacheBuilder(scene, output.toString());
            builder.setCompressedTextureType(CompressedTextureType.DDS);//压缩方式,PC
            //builder.setProcessThreadsCount(8);//处理线程
            builder.setStorageType(StorageType.Original);//存储方式,原始
            builder.setIsCalNormal(false);
            builder.setIsInstance(true);
            //2.1 设置需要生成缓存的普通图层和地形图层
            String[] layerNameArr = layerNames.toArray(new String[] {});
            builder.setOutputLayerNames(layerNameArr);//三维自定义图层
            builder.setOutputTerrainLayerNames(null);//地形图层不生成
            //2.2 场景和工作空间输出参数
            builder.setOutputSceneName("Scene");//设置新生成的场景名称
            Path path = Paths.get(output.toString(),workspaceName+ ".smwu");//*工作空间路径
            connectionInfo.setServer(path.toString());//工作空间路径
            builder.setOutputWorkspaceConnectionInfo(connectionInfo);
            //2.3 开始生成缓存
            flag = builder.build();
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return false;
        }
        finally {
            builder.dispose();
            builder = null;
        }
        return flag;
    }


Stack: [0x000000004e9b0000,0x000000004eab0000],  sp=0x000000004eaae858,  free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.supermap.data.processing.SceneCacheBuilderNative.jni_Build(JJLjava/lang/String;)Z+0
j  com.supermap.data.processing.SceneCacheBuilder.build()Z+108
j  z.s.cache.util.CacheSeverHelper.SceneCacheBuild(Lcom/supermap/realspace/Scene;Ljava/nio/file/Path;Ljava/lang/String;)Ljava/lang/Boolean;+344
j  z.s.cache.util.CacheSeverHelper.BuildSceneCache(Lcom/supermap/data/Workspace;)Ljava/lang/Boolean;+181
j  z.s.cache.util.CacheSeverHelper.BuildAndPubilshScene(Lcom/supermap/data/Workspace;)Ljava/lang/String;+44
j  z.s.cache.util.CacheSeverHelper.PublishAll(Ljava/lang/String;Ljava/lang/String;)Lcom/alibaba/fastjson/JSONObject;+51
j  z.s.cache.service.cacheSrv.publishServices(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)V+475
j  z.s.cache.thread.CacheThread.run()V+23
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub
 

问题关闭原因: 问题已解决,是远程桌面连接导致的。
11月 13, 2019 分类:  182次浏览 | 用户: 行者不懂 牛刀小试 (229 分)
已关闭 11月 18, 2019 用户:行者不懂

1个回答

0 投票
您好,切缓存的电脑是需要有显卡的。运行崩溃那台电脑是什么配置呢?电脑的显卡是什么显卡,是否是最新的显卡驱动。
11月 14, 2019 用户: 董懿鑫 登峰造极 (7,152 分)
NVIDIA GeForce RTX 2080 Ti

桌面端能够正常切啊
麻烦说一下您那边的使用场景,是在开发平台上直接运行的还是打包成jar包呢?在代码中多打印输出一下,看一下是否都运行正常,然后提供一下完整的报错日志

打包成jar包,自己输出信息如下

新建工作空间、数据源,导入符号库……
矢量化:HS
数据库点表查询
数据库线表查询
二维点用时: 2312
获取埋深、管径信息映射表
三维点用时: 4829
二维线用时: 687
三维线用时: 703
三维网络用时: 2718
三维线分析用时: 672
三维网络分析用时: 3078
矢量化:YS
数据库点表查询
数据库线表查询
二维点用时: 3876
获取埋深、管径信息映射表
三维点用时: 59701
二维线用时: 4750
For input string: ""
三维线用时: 4704
三维网络用时: 17780
三维线分析用时: 5594
三维网络分析用时: 23500
矢量化:WS
数据库点表查询
数据库线表查询
二维点用时: 859
获取埋深、管径信息映射表
三维点用时: 19251
二维线用时: 1015
For input string: ""
三维线用时: 1047
三维网络用时: 3999
三维线分析用时: 1500
三维网络分析用时: 5112
符号化:HS
符号化:YS
符号化:WS
正在保存工作空间:
true【正在构建场景缓存……】
工作空间为:D:\Temp\iServer\source\wk20191113_2152.smwu
正在获取场景……
获取场景成功
正在新建场景……
打开场景true
设置输出目录
场景中图层数量:9
场景中三维自定义专题图层数量:9


崩溃日志

#

# A fatal error has been detected by the Java Runtime Environment:

#

#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000000000000, pid=8952, tid=0x0000000000003c30

#

# JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11)

# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode windows-amd64 compressed oops)

# Problematic frame:

# C  0x0000000000000000

#

# 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 (0x0000000044bd1800):  JavaThread "Thread-9" [_thread_in_native, id=15408, stack(0x000000004e9b0000,0x000000004eab0000)]

siginfo: ExceptionCode=0xc0000005, ExceptionInformation=0x0000000000000008 0x0000000000000000

Registers:

RAX=0x0000000053879730, RBX=0x0000000053879730, RCX=0x0000000000008006, RDX=0x0000000000000000

RSP=0x000000004eaae858, RBP=0x000000004eaaea50, RSI=0x00000000823ada40, RDI=0x00000000823b3b60

R8 =0x000000004eaae828, R9 =0x0000000000000000, R10=0x00000000680f7010, R11=0x0000000000000000

R12=0x00007ffedfa3b8d8, R13=0x0000000000000000, R14=0x0000000053a532b0, R15=0x000000004eaaee50

RIP=0x0000000000000000, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x000000004eaae858)

0x000000004eaae858:   00007ffef64e7cf4 0000000068780f10

0x000000004eaae868:   0000000050011d2d fffffffffffffffe

0x000000004eaae878:   fffffffffffffffe 000000004eaaeaf8

0x000000004eaae888:   00007ffef64dec46 0000000053879730

0x000000004eaae898:   000000007cd885e0 000000004eaaee50

0x000000004eaae8a8:   0000000000000000 000000007cd885e0

0x000000004eaae8b8:   00007ffef6496f19 fffffffffffffffe

0x000000004eaae8c8:   00000000454c7330 00007fff222679a4

0x000000004eaae8d8:   00007fff22267970 0000000053a532b0

0x000000004eaae8e8:   00007ffef64c9f71 0000000053879730

0x000000004eaae8f8:   000000004eaaeaf8 0000000000000000

0x000000004eaae908:   000000007cd885e0 fffffffffffffffe

0x000000004eaae918:   00000000823b3800 000000000000000f

0x000000004eaae928:   000000000000001b 000000000000001f

0x000000004eaae938:   0000f9d268c27998 0000000000000000

0x000000004eaae948:   00007ffef64c25da 000000004eaaea00 

Instructions: (pc=0x0000000000000000)

0xffffffffffffffe0:   

Register to memory mapping:

RAX=0x0000000053879730 is an unknown value

RBX=0x0000000053879730 is an unknown value

RCX=0x0000000000008006 is an unknown value

RDX=0x0000000000000000 is an unknown value

RSP=0x000000004eaae858 is pointing into the stack for thread: 0x0000000044bd1800

RBP=0x000000004eaaea50 is pointing into the stack for thread: 0x0000000044bd1800

RSI=0x00000000823ada40 is an unknown value

RDI=0x00000000823b3b60 is an unknown value

R8 =0x000000004eaae828 is pointing into the stack for thread: 0x0000000044bd1800

R9 =0x0000000000000000 is an unknown value

R10=0x00000000680f7010 is an unknown value

R11=0x0000000000000000 is an unknown value

R12=0x00007ffedfa3b8d8 is an unknown value

R13=0x0000000000000000 is an unknown value

R14=0x0000000053a532b0 is an unknown value

R15=0x000000004eaaee50 is pointing into the stack for thread: 0x0000000044bd1800

Stack: [0x000000004e9b0000,0x000000004eab0000],  sp=0x000000004eaae858,  free space=1018k

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)

j  com.supermap.data.processing.SceneCacheBuilderNative.jni_Build(JJLjava/lang/String;)Z+0

j  com.supermap.data.processing.SceneCacheBuilder.build()Z+108

j  z.s.cache.util.CacheSeverHelper.SceneCacheBuild(Lcom/supermap/realspace/Scene;Ljava/nio/file/Path;Ljava/lang/String;)Ljava/lang/Boolean;+344

j  z.s.cache.util.CacheSeverHelper.BuildSceneCache(Lcom/supermap/data/Workspace;)Ljava/lang/Boolean;+181

j  z.s.cache.util.CacheSeverHelper.BuildAndPubilshScene(Lcom/supermap/data/Workspace;)Ljava/lang/String;+44

j  z.s.cache.util.CacheSeverHelper.PublishAll(Ljava/lang/String;Ljava/lang/String;)Lcom/alibaba/fastjson/JSONObject;+51

j  z.s.cache.service.cacheSrv.publishServices(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)V+475

j  z.s.cache.thread.CacheThread.run()V+23

j  java.lang.Thread.run()V+11

v  ~StubRoutines::call_stub

全部崩溃日志太长,放不上来
...