Select to view content in your preferred language

3.9 Internal Server Error 500

6436
22
05-14-2014 05:27 AM
BrianCowan
New Contributor
I downloaded ArcGIS 3.9 but after updating the files and running my map I got the following error

GET http://localhost:9000/proxy?./proxy?http://services.arcgisonline.com/ArcGIS/rest/services/World_Stre...   500 (Internal Server Error)

Any help would be greatly appreciated!
0 Kudos
22 Replies
JeffPace
MVP Alum

Where do you set using the proxy in your application?

i.e.

esri.config.defaults.io.proxyUrl = 'proxy.jsp';

0 Kudos
TamaraOsborn
New Contributor

In appFunctions.js which is where I keep all my app objects.

Below is the order of scripts in index.html. appFunctions is the 3rd one in the list.

  <script src="wsdmConfig.js"></script>

  <script src="http://js.arcgis.com/3.9/"></script>

  <script src="lib/appFunctions.js"></script>

  <script src="view/effortForm.js"></script>

  <script src="view/effortMap.js"></script>

  <script src="view/occurrenceMap.js"></script>

  <script src="view/occurrenceForm.js"></script>

0 Kudos
JeffPace
MVP Alum

in appfunctions.js, what is the actual line that sets it? it feels like you are pathing incorrecting (especially if hardcoding the path fixes it)

0 Kudos
TamaraOsborn
New Contributor

Hardcoding path didn't fix it - see above reply to Matthew Lofgren. The 2 lines I have in appFunctions.js are:

  esri.config.defaults.io.proxyUrl = "proxy/proxy.jsp";

  esri.config.defaults.io.alwaysUseProxy = true;

My file structure is:

   proto1

     index.html

     /proxy

        proxy.jsp

     /lib

        appFunctions.js

I tried moving only proxy.jsp to the root folder - same errors. Then I tried moving only appFunctions.js to the root folder. Same errors. Then I tried moving both files to my root. Same errors. So far it doesn't seem like a pathing issue. 

Here's the invalid request URL: http://localhost:8080/proto1/proxy.jsp?proxy.jsp?http://services.arcgisonline.com/ArcGIS/rest/servic...

And here's another call in the same session that is formatted correctly and worked fine: http://localhost:8080/proto1/proxy.jsp?http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Stre...

0 Kudos
JeffPace
MVP Alum

If you get some good requests, it sounds like the pathing to the proxy are set up properly.  That leaves two possibilites

1. Internally in the proxy there is an error causing it to be recursively called

2. Something about the resource it self, or the way you defined it, is causing the duplicate issue.

Can you show the code in the proxy, and the code where you add the problematic world_topo_map service

0 Kudos
TamaraOsborn
New Contributor

I stripped out everything to the bare minimum and flattened all my code. Still have the problem. To me, it appears there is a bug in the proxy. So here's all the code I have now. Apologies for the length. If you'd like, I can also email you the files. Appreciate any help you can give me. I haven't tried to debug the proxy itself.

My app now consists of only 3 files: index.html, proxy.jsp and proxy.config. Structure is:

proto1 (root)

  index.html

  proxy.jsp

  WEB-INF/classes/proxy.config

Index.html code:

<!DOCTYPE html>

<html>

<head>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  <title>Butterflies Survey</title>

  <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dojo/resources/dojo.css">

  <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/dijit.css">

  <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css">

  <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">

  <script src="http://js.arcgis.com/3.9/"></script>

  <script>

    require(["esri/map", "dojo/domReady!"],

      function (Map ) {

        esri.config.defaults.io.proxyUrl = "proxy.jsp";

        esri.config.defaults.io.alwaysUseProxy = true;

        var effortMap = new Map("effortMap", {

            center: [-122.3348, 47.5978],

            zoom: 6,

            sliderStyle: "large",    

            basemap: "topo"

          });

      });

  </script>

</head>

<body class="claro">

  <div id="EffortLocationContainer" class="wrapper">

    <section>

      <div id="effortMap"></div>

    </section>

  </div>

  <br/>

</body>

</html>

Proxy.config code:

<?xml version="1.0" encoding="utf-8" ?>

<ProxyConfig allowedReferers="*"

                logFile="proxy_log.log"

                logLevel="INFO"

                mustMatch="true">

  <serverUrls>

    <serverUrl url="http://services.arcgisonline.com"

        matchAll="true"/>

    <serverUrl url="http://server.arcgisonline.com"

        matchAll="true"/>

    <serverUrl url="http://static.arcgis.com"

        matchAll="true"/>

  </serverUrls>

</ProxyConfig>

Proxy.jsp code can be found on github - ver 1.0: https://github.com/Esri/resource-proxy/releases

0 Kudos
JeffPace
MVP Alum

Ok two things, first edit you response. click go advanced editing.  Then highlight the code, hit the doubleright arrow (bottom right) and select syntax highlighting, and choose java.

Ok second.  wow, thats complicated.  My concern is the proxyrefered.  It looks like you are defining the proxy, and so is ESRI.  So both of you are proxying requests.

Can you try setting alwaysuseproxy to false?

0 Kudos
TamaraOsborn
New Contributor

Actually, instead of including the proxy.jsp code, i replaced it with the link to github where it can be downloaded. I haven't modified it at all.

Of course setting alwaysUseProxy to false will cause it to bypass the proxy then the errors do not happen. Is that the recommendation from ESRI?

Why would the proxy work for #1 below but not #2?

  1. http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/tile/6/15/19
  2. http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tilemap/6/16/8/8/8
0 Kudos
JeffPace
MVP Alum

wish i could see more of your code.  It really sounds like you have a double reference to the proxy. Especially since hardcoding it makes the hardcoded value show up twice.

Are you doing any request modification? can you post appfunctions.js?

0 Kudos
JeffPace
MVP Alum

does this on work?

World_Topo_Map (MapServer)

im noticing that the second one is using a tilemap and not tile.. seems like a different format, and if you go straight to the path, the first link returns a tile, the second one does not

0 Kudos