Hi,
I have some issues when using esri proxy Java Version,
Releases · Esri/resource-proxy · GitHub
After deploying it on tomcat , it still telling me that proxy.config file is not readable or it doesn't exist.
I am sure that the file exist at this location,
any idea ?
Thanks,
Solved! Go to Solution.
In fact ,
I have resolved the problem by putting the URL of page requesting the service inside the proxy.config file
using option allowedReferers. allowedReferers="*" is not working for me, I had to replace * by my page url.
Maxim,
Thanks you guys trying helping me.
Hi Maxim,
Did you follow the instructions of the README.md file?
What do you receive when you enter the following url?:
http://[yourmachine]/Java/proxy.jsp?http://services.arcgisonline.com/ArcGIS/rest/services/?f=pjson
Richard
Hi,
When I enter http://localhost:8080/Java/proxy.jsp?http://services.arcgisonline.com/ArcGIS/rest/services/?f=pjson
It says :
Hi,Hi,
Hi,
it is now working with tomcat, when typing the folowwing URL in the browser it forwads me the site
But when using the API , it tells me that the ressource is forbidden (403 errror code), here is my config
esriConfig.defaults.io.proxyUrl = "http://localhost:8080/Java/proxy.jsp"
var wmsLayer = new WMSLayer("http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StateCityHighway_USA/MapServer/...", {
format: "png",
visibleLayers: [2]
});
map.addLayer(wmsLayer);
Any idea ?
Thanks
Check that you have allowed the ESRI sample server URL in your proxy configuration file. The following example allows access to 2 servers:
<?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://sampleserver1.arcgisonline.com" matchAll="true"/>
</serverUrls>
</ProxyConfig>
Trying to access any server not in this list should result in a 403 error from your proxy.
Owen
Hi thanks ,
My proxy.config is configured like you suggested, but still doesn't work. still forbiden acces to
when executing JavaScript code.
But when I copy past this url to the browser , it redirect me to the site.
Any idea why it is not working in a javascript code ? Thanks
He is my code in JS:
esriConfig.defaults.io.proxyUrl = "http://localhost:8080/Java/proxy.jsp";
map = new Map("map", {
basemap: "streets",
center: [-98, 37],
zoom: 5
});
var wmsLayer = new WMSLayer("http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StateCityHighway_USA/MapServer/...", {
format: "png",
visibleLayers: [2]
});
map.addLayer(wmsLayer);
In fact ,
I have resolved the problem by putting the URL of page requesting the service inside the proxy.config file
using option allowedReferers. allowedReferers="*" is not working for me, I had to replace * by my page url.
Maxim,
Thanks you guys trying helping me.