首页 / 浏览问题 / 云GIS / 问题详情
iportal地图打印问题
11EXP 2024年01月04日

请问iportal调用打印服务之后打印失败,iserver日志输出

java.lang.IllegalStateException: webmap is not reached
    at com.supermap.services.webprint.output.WebContentAttributeFillerImpl.a(SourceFile:396) ~[iserver-all-10.2.1-20429.jar:?]
    at com.supermap.services.webprint.output.WebContentAttributeFillerImpl.parseAndFillMapAttribute(SourceFile:65) ~[iserver-all-10.2.1-20429.jar:?]
    at com.supermap.services.webprint.output.WebContentAttributeFillerImpl.a(SourceFile:529) ~[iserver-all-10.2.1-20429.jar:?]
    at com.supermap.services.webprint.output.WebContentAttributeFillerImpl.fillter(SourceFile:523) ~[iserver-all-10.2.1-20429.jar:?]
    at org.mapfish.print.output.Values.<init>(Values.java:139) ~[print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.output.Values.<init>(Values.java:102) ~[print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.output.AbstractJasperReportOutputFormat.getJasperPrint(AbstractJasperReportOutputFormat.java:141) ~[print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.output.AbstractJasperReportOutputFormat.print(AbstractJasperReportOutputFormat.java:98) ~[print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.MapPrinter.print(MapPrinter.java:136) ~[print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.servlet.job.PrintJob.lambda$call$0(PrintJob.java:130) ~[print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.servlet.job.PrintJob.withOpenOutputStream(PrintJob.java:107) ~[print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:130) [print-lib-sm-3.23.1-59.jar:?]
    at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:48) [print-lib-sm-3.23.1-59.jar:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_77-Ubuntu]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_77-Ubuntu]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_77-Ubuntu]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77-Ubuntu]

web界面报错打印失败,network请求地址

ip:port/web/webprinting/jobs/61d6a33e-88d8-4e45-8b24-76b2c62d197f@dbfec50f-4b57-4ff6-b3cd-98b6afc44814.json

返回状态"status": "ERROR"

1个回答

您好,您测试一下同样的参数在iserver打印是否成功。也失败的话打开请求地址查看是否有详细报错,检查打印的地图服务预览是否正常。
3,148EXP 2024年01月04日
你好,可以具体点吗,没太懂您的意思
您直接在配置的iserver web打印服务测试以下参数是否可以正常打印:

{

    "layoutOptions": {

        "templateName": "A4_landscape",

        "title": "主标题",

        "subTitle": "副标题",

        "author": "作者",

        "copyright": "版权信息",

        "northArrowOptions": {

        },

        "scaleBarOptions": {

            "scaleText": "比例尺"

        },

        "legendOptions": {

            "title": "图例",

            "customItems": [

                {

                    "name": "重要设置",

                },

                {

                    "name": "河流",

                    "picAsUrl":

                        "https://iserver.supermap.io/iserver/services/map-china400/rest/maps/China/layers/River@China@@China/legend"

                    

                },

                {

                    "name": "主干道",

                    "picAsUrl":

                        "https://iserver.supermap.io/iserver/services/map-china400/rest/maps/China/layers/Main_Road_L@China@@China/legend"

                    

                }

            ]

        },

        "littleMapOptions": {

            "center": {

                "x": 12659780.84769,

                "y": 1630935.5331

            },

            "scale": 2.63157894736842E-08,

            "layers": [

                {

                    "layerType": "TILE",

                    "name": "China",

                    "url": "https://iserver.supermap.io/iserver/services/map-china400/rest/maps/China"

                }

            ]

        }

    },

    "exportOptions": {

        "format": "pdf",

        "dpi": 96

    },

    "content": {

        "type": "WEBMAP",

        "value": {

            "maxScale": "1:144447.927",

            "level": 4,

            "center": {

                "x": 12024583.8595938,

                "y": 4101942.08146721

            },

            "layers": [

                {

                    "layerType": "TILE",

                    "name": "China",

                    "url": "https://iserver.supermap.io/iserver/services/map-china400/rest/maps/China"

                }

            ],

            "description": "",

            "projection": "EPSG:3857",

            "minScale": "1:591658710.909",

            "title": "china_point",

            "version": "2.0.0"

        }

    }

}

判断原始web打印服务是否可以正常打印,如果iserver服务正常,需要检查一下打印的地图保存重新打开是否正常判断地图是否存在异常,或者测试其他地图比如未添加数据的默认底图打印是否正常。
您好,我这边测试了使用你给参数确实打印成功了,我自己的参数如下

{
  "result": {
    "downloadUrl": "http://192.168.9.22/web/webprinting/jobs/bdafcfaa-7692-4fda-ac61-7ca6c5f7c56d@dbfec50f-4b57-4ff6-b3cd-98b6afc44814/result"
  },
  "startTime": "2024-01-04 14:22:29",
  "id": "bdafcfaa-7692-4fda-ac61-7ca6c5f7c56d@dbfec50f-4b57-4ff6-b3cd-98b6afc44814",
  "endTime": "2024-01-04 14:22:42",
  "info": {
    "layoutOptions": {
      "template": "A2_landscape",
      "copyright": "版权信息",
      "littleMapOptions": {
        "center": {
          "x": 112.24743340400008,
          "y": 31.152992622000056
        },
        "scale": 4.331667825138369e-7,
        "layerNames": [
          "天地图影像(经纬度)",
          "湖北省行政区划@湖北省行政区划1"
        ]
      },
      "subTitle": "副标题",
      "templateName": "A2_landscape",
      "author": "iportal",
      "legendOptions": {
        "picAsBase64": "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAFM0aXcAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAD6ADAAQAAAABAAAADwAAAAAHNtsJAAAAE0lEQVQoFWNgGAWjITAaAoM2BAADoQABUmn/6gAAAABJRU5ErkJggg==",
        "title": ""
      },
      "title": "湖北区划测试",
      "scaleBarOptions": {
        "orientation": "HORIZONTALLABELSBELOW",
        "intervals": 3,
        "unit": "METER",
        "scaleText": "1:2308579.605750486",
        "type": "LINE"
      }
    },
    "exportOptions": {
      "format": "PDF",
      "dpi": 96
    },
    "content": {
      "type": "WEBMAP",
      "url": "http://192.168.9.22/web/maps/1598954905/map.json",
      "token": ""
    }
  },
  "status": "ERROR"
}

问下我这个是底图的原因吗,我那个天地图影像确实没出来
您天地图影像是直接服务上图还是修改的数据上图底图呢?影像没出来是指在数据上图的地图中就加载不出来吗?如果数据上图预览就加载失败的话,您试试不要天地图影像是否可以打印成功。
...