That's right it happens for the baseMap. My original code for the map was posted earlier but here it is again:
var effortMap = new Map("effortMap", {
center: [-122.3348, 47.5978],
zoom: 6,
sliderStyle: "large",
basemap: "streets"
});
I only did the basemap as a layer per your request to see if the link you sent me worked.
ahh ok so it is only on the layer you set as a basemap when you define your map object?
did you post your code where you do new Map
Yes and no. If I add the World_Topo_Map as a ArcGISTiledMapServiceLayer I get the same errors. If I add it as a ArcGISDynamicMapServiceLayer, I don't get the errors. I don't think that's a good solution because I don't want to render it dynamically.
I don't know how to set the basemap other than using map name. By the way, I also tried other basemaps, street, oceans etc. All of them result in the same error. For example:
http://localhost:8080/proto1ProxyTest/proxy.jsp?proxy.jsp?http://services.a…ine.com/ArcGIS/rest/services/World_Street_Map/MapServer/tilemap/6/16/8/8/8".
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
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;
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"
<serverUrl url="http://static.arcgis.com"
</serverUrls>
</ProxyConfig>
Proxy.jsp code can be found on github - ver 1.0: https://github.com/Esri/resource-proxy/releases
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
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";
My file structure is:
proto1
/proxy
/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/services/World_Topo_Map/MapServer/tilemap/6/16/8/8/8
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_StreetMap_World_2D/MapServer/tile/6/15/19
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?
Thanks for the suggestion. Hardcoding the path ( esri.config.defaults.io.proxyUrl = "http://localhost:8080/proto1/proxy/proxy.jsp";) didn't fix the problem. The same thing happens where the proxy appears twice in the request URL - see below.
http://localhost:8080/proto1/proxy/proxy.jsp?http://localhost:8080/proto1/proxy/proxy.jsp?http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tilemap/6/16/8/8/8
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)
I had this problem too. I came across a post, that I can't seem to find now, that said to use an absolute path rather than relative path because of some bug.
So, something like this:
esriConfig.defaults.io.proxyUrl = "http://yourServer/proxy.ashx"; //Full path required due to some bug....
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="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>
Where do you set using the proxy in your application?
i.e.
esri.config.defaults.io.proxyUrl = 'proxy.jsp';
I am having exactly the same problem where the proxy appears twice in the request URL. This is also specific to tilemap like Brian's problem.
I am using the latest JSP proxy from github, ver 1.0. I have not modified the proxy at all. My proxy.config has the following in it:
My other calls are fine, it is just a couple for tilemap that are failing because of the invalid url format.
If you fixed it, how did you do it?
Thank you for your response Noah!I had everything working fine with 3.8 but upgrading to 3.9 caused that to crash after downloading it, changing the files, and updating the database. From what I could tell it had to do with it trying to access the proxy twice in the GET call GET http://localhost:9000/proxy?./proxy......from init.js, but I never had that problem with 3.8. Is there a separate download needed for it to work with the existing project?Thank you
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.