Select to view content in your preferred language

Web Map Export Task with produces 'Error performing execute operation'

4864
3
09-25-2012 08:20 AM
SebastianIrsch
New Contributor
When I try to export a Web Map with client side graphics it results in an error.

The resouce we use is http://resources.arcgis.com/en/help/main/10.1/0154/0154000004w8000000.htm .

The json object we use for Web_Map_as_JSON parameter is:

{
    "mapOptions": {
        "extent": {
            "xmin": 1044845.4461999984,
            "xmax": 1090943.768199999,
            "ymin": 7186830.843199998,
            "ymax": 7224868.997599997,
            "spatialReference": {
                "wkid": 102100
            }
        },
        "scale": 100000,
        "spatialReference": {
            "wkid": 102100
        }
    },
    "operationalLayers": [
        {
            "id": "RouteLayer",
            "title": "Route Layer",
            "opacity": 1,
            "visibility": true,
            "featureCollection": {
                "layers": [
                    {
                        "layerDefinition": {
                            "name": "Route",
                            "geometryType": "esriGeometryPolyline",
                            "drawingInfo": {
                                "renderer": {
                                    "type": "simple",
                                    "description": "",
                                    "symbol": {
                                        "type": "esriSLS",
                                        "width": 5,
                                        "style": "esriSLSSolid",
                                        "color": [
                                            0,
                                            0,
                                            255,
                                            128
                                        ]
                                    },
                                    "label": ""
                                }
                            }
                        },
                        "featureSet": {
                            "features": [
                                {
                                    "geometry": {
                                        "hasZ": false,
                                        "hasM": false,
                                        "paths": [
                                            [
                                                [
                                                    1044845.4461999984,
                                                    7224432.205300003, 0, 0
                                                ],
                                                [
                                                    1089023.6741999984,
                                                    7189999.173699997, 0, 0
                                                ]
                                            ]
                                        ],
                                        "spatialReference": {
                                            "wkid": 102100
                                        }
                                    }
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ],
    "baseMap": {
        "title": "",
        "baseMapLayers": [
            {
                "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",
                "opacity": 1
            }
        ]
    },
    "exportOptions": {
        "dpi": 96,
        "outputSize": [
            600,
            400
        ]
    }
}


Other params are:
Format=JPG&Layout_Template=MAP_ONLY&f=json

The server log contains the following entry:
Internal  Server Error. Error handling service request: Could not service  request. java.rmi.UnmarshalException: Error unmarshaling return header;  nested exception is:   java.net.SocketException: Connection reset

Is there any further documentation about client side graphics available?
Are there any examples?
Tags (2)
0 Kudos
3 Replies
SebastianIrsch
New Contributor
Request that causes the problem (hosts changed):
sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute
?Format=png32
&Layout_Template=MAP_ONLY
&Web_Map_as_JSON=
{
"mapOptions":{
"extent":{
"xmin":1044845.4461999984,
"xmax":1090943.768199999,
"ymin":7186830.843199998,
"ymax":7224868.997599997,
"spatialReference":{
"wkid":102100
}
},
"scale":100000,
"spatialReference":{
"wkid":102100
}
},
"operationalLayers":[
{
"id":"RouteLayer",
"title":"Route Layer",
"opacity":1,
"visibility":true,
"featureCollection":{
"layers":[
{
"layerDefinition":{
"name":"Route",
"geometryType":"esriGeometryPolyline",
"drawingInfo":{
"renderer":{
"type":"simple",
"description":"",
"symbol":{
"type":"esriSLS",
"width":5,
"style":"esriSLSSolid",
"color":[
0,
0,
255,
128
]
},
"label":""
}
}
},
"featureSet":{
"features":[
{
"geometry":{
"hasZ":false,
"hasM":false,
"paths":[
[
[
1044845.4461999984,
7224432.205300003,
0,
0
],
[
1089023.6741999984,
7189999.173699997,
0,
0
]
]
],
"spatialReference":{
"wkid":102100
}
}
}
]
}
}
]
}
}
],
"baseMap":{
"title":"",
"baseMapLayers":[
{
"url":"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",
"opacity":1
}
]
},
"exportOptions":{
"dpi":96,
"outputSize":[
960,
640
]
}
}
&f=json


Extract from server log file:
ArcGIS Server 10.1 Log:

Level: SEVERE
Time: Sep 26, 2012 9:44:13 AM
Message: Utilities/PrintingTools.GPServer failed to process request.
Source: Server


Level: SEVERE
Time: Sep 26, 2012 9:44:20 AM
Message:
Internal Server Error. Error handling service request: Could not service request.
java.rmi.UnmarshalException: Error unmarshaling return header;
nested exception is: java.net.SocketException: Connection reset

Source: Rest



<Msg time="2012-09-26T09:56:35,205" type="SEVERE" code="8259" source="Server" process="2400" thread="1" methodName="" machine="BLANCAPEAK.ALTA4.LOCAL" user="" elapsed="">Utilities/PrintingTools.GPServer failed to process request.</Msg>
<Msg time="2012-09-26T09:56:35,211" type="DEBUG" code="9999" source="Server" process="2400" thread="1" methodName="" machine="BLANCAPEAK.ALTA4.LOCAL" user="" elapsed="">java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.net.SocketException: Connection reset
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:209)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
at $Proxy44.handleRequest(Unknown Source)
at com.esri.arcgis.discovery.ejb.util.EJBBase.handleRequestBase(EJBBase.java:460)
at com.esri.arcgis.discovery.ejb.impl.GPServerSyncBean.handleRequest(GPServerSyncBean.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:162)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:144)
at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:164)
at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:92)
at sun.reflect.GeneratedMethodAccessor301.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:162)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:144)
at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:122)
at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:221)
at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:174)
at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:136)
at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:196)
at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:149)
at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:71)
at org.apache.openejb.server.ejbd.KeepAliveServer$Session.service(KeepAliveServer.java:213)
at org.apache.openejb.server.ejbd.KeepAliveServer.service(KeepAliveServer.java:233)
at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:66)
at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:91)
at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:120)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at java.io.DataInputStream.readByte(DataInputStream.java:248)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:195)
... 36 more
</Msg>


link http://forums.arcgis.com/threads/60714-ArcGIS-server-10.1-PrintingTool
0 Kudos
OleSeidel1
Regular Contributor
... try to export a Web Map with client side graphic .....

The resouce we use is http://resources.arcgis.com/en/help/main/10.1/0154/0154000004w8000000.htm .
...
Is there any further documentation about client side graphics available?
Are there any examples?


Indeed, the documentation makes it sound like adding client side graphics (like a simple polygon or a box someone draws) are supported in the new serverside printing (web map export). The documentation does have the syntax described however it is missing the example (it is actually the only part in this help document, where the example is missing).

Any suggestions are highly welcome. We will post a summary of the solution once we find it.

Ole
0 Kudos
TanuHoque
Esri Regular Contributor
Sorry about the inconvenience. The reason it is failing is because the json does not have "geometryType" defined in the "featureSet" element.

here is the correct one (please see the attachment for the entire json)
...
"featureSet": {
    "geometryType": "esriGeometryPolyline",
        "features": [
                {
...


Apparently it was missing from the help. We will update the help as well as put an example. Thanks for your comment.

Quick question: may I ask why are you constructing the JSON manually instead of relying on PrintTask of any of Web APIs?
0 Kudos