Select to view content in your preferred language

Error executing print task

3484
7
Jump to solution
08-15-2012 03:57 AM
philippschnetzer
Frequent Contributor
Using the server 10.1 and flexviewer 3.0

I am getting the following error after creating my own printing service (so that I can create custom layouts):

Error executing print task: [RPC Fault faultString="Unexpected < encountered at location 5" faultCode="null" faultDetail="null"]


I followed the instructions here:  http://resources.arcgis.com/en/help/main/10.1/index.html#/Publishing_additional_services_for_printin...

I registered my folder containing the mxds with the server manager and when i load my web app i can see all of my mxds available as options in the "Layout templates" dropdown box using the out-of-the-box print widget.

As soon as I switch the <taskurl> in the printwidget.xml to use esri's service my print widget works fine...

Any thoughts?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
philippschnetzer
Frequent Contributor
I got it working, after I enabled the JSON mime type on the server (Windows Server 2008R2, IIS 7) it works fine.  Here were my steps:


  1. Open IIS Manager

  2. Display properties for the IIS Server

  3. Click MIME Types and then add the JSON extension:

  4. File name extension: .json

  5. MIME type: application/x-javascript

  6. Go back to the properties for IIS Server

  7. Click on Handler Mappings

  8. Add a script map

  9. Request path: *.json

  10. Executable: C:\WINDOWS\system32\inetsrv\asp.dll

  11. Name: JSON

By the way, being able to send a map to our own layouts is pretty great...kudos

View solution in original post

0 Kudos
7 Replies
DasaPaddock
Esri Regular Contributor
Can you see what the response from the server is using a tool like HttpFox?
0 Kudos
philippschnetzer
Frequent Contributor
I installed httpfox...not exaclty sure what I am looking for..but, under POST Data it says "(This request contained no POST data)".

Here's the line that appeared when the error appeared:

Time 100.346  Sent 2167    Received 974 GET     Result 200      Type text/html  

Also, here is what was under Query String:

Web_Map_as_JSON {"layoutOptions":{"authorText":"dfgsdfg","titleText":"sdfgsdfg","copyrightText":"sdfgsdfg","legendOptions":{"operationalLayers":[{"id":"LAYERS"},{"id":"ACTIVE MUN. PROJECT"},{"id":"PUBLIC SERVICE REQUEST"}]}},"mapOptions":{"extent":{"ymin":5611966.621373951,"xmin":-7245244.711364625,"spatialReference":{"wkid":102100},"ymax":5613323.378626049,"xmax":-7241585.288635375}},"exportOptions":null,"operationalLayers":[{"id":"Aerial","title":"Aerial","url":"http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"},{"id":"Aerial","title":"Aerial","url":"http://www.XXX.com/lgswebadaptor/rest/services/LIUdemoAerial/MapServer"},{"visibleLayers":[1,2,3,5,19,24],"id":"LAYERS","title":"LAYERS","url":"http://www.XXX.com/lgswebadaptor/rest/services/LIUdemoDynamic/MapServer"},{"id":"ACTIVE MUN. PROJECT","title":"ACTIVE MUN. PROJECT","opacity":0,"url":"http://www.XXX.com/lgswebadaptor/rest/services/LIUdemoEditable/FeatureServer/0"},{"id":"PUBLIC SERVICE REQUEST","title":"PUBLIC SERVICE REQUEST","opacity":0,"url":"http://www.XXX.com/lgswebadaptor/rest/services/LIUdemoEditable/FeatureServer/1"}]}


Thanks!
0 Kudos
DasaPaddock
Esri Regular Contributor
The response should be shown in the Content tab.
0 Kudos
philippschnetzer
Frequent Contributor
Here's what was in the Content tab:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <style type="text/css">

        #headerIMG
        {
            width: 100%;
            height: auto;
        }
        .center
        {
            font-family: Arial,Verdana,arial,sans-serif;
            font-size: 15px;
            width: 70%;
        }
        
        .errorTitle
        {
          color:Navy; 
          font-size:large; 
          font-family: Arial,Verdana,arial,sans-serif;
          font-weight:bold;
        }
        
        .errorLabel
        {
          font-family: Arial,Verdana,arial,sans-serif;
          font-size: 15px;
        }
  </style>
  <title>
 Application Error
</title></head>
<body>
    <p>
        <img src="/lgswebadaptor/webadaptor/header.jpeg" id="headerIMG" alt="ArcGIS Web Adaptor" longdesc="ArcGIS Web Adaptor Configuration" />
    </p>
    <p id="helpLinkElement" class="center" align="right">
        <a id="helpLink" href="../../../../../WebAdaptorHelp/Index.html" target="_blank">Help</a>
    </p>
        <p class="errorTitle">
            Application Error
        </p>
        <p class="errorLabel">
            The operation has timed out
        </p>
</body>
</html>


Doesn't look like this is of any help...but like I said before I'm not sure what I'm looking for...

Thanks again!
0 Kudos
DasaPaddock
Esri Regular Contributor
The fault "Unexpected < encountered at location 5" is because this is HTML coming back from the server instead of JSON so the JSON parser fails.

The HTML seems to be coming from the ArcGIS Web Adaptor saying "The operation has timed out".

I'd suggest contacting Esri Tech Support at http://support.esri.com/
0 Kudos
philippschnetzer
Frequent Contributor
I got it working, after I enabled the JSON mime type on the server (Windows Server 2008R2, IIS 7) it works fine.  Here were my steps:


  1. Open IIS Manager

  2. Display properties for the IIS Server

  3. Click MIME Types and then add the JSON extension:

  4. File name extension: .json

  5. MIME type: application/x-javascript

  6. Go back to the properties for IIS Server

  7. Click on Handler Mappings

  8. Add a script map

  9. Request path: *.json

  10. Executable: C:\WINDOWS\system32\inetsrv\asp.dll

  11. Name: JSON

By the way, being able to send a map to our own layouts is pretty great...kudos
0 Kudos
philippschnetzer
Frequent Contributor
im gonna post here again in case someone else needs to know...

turns out I was only temporarily right, adding the json mime type worked for about 5 or 6 exports and then the same error (as above) returned...

back to the drawing board...
0 Kudos