issues with esri proxy

2003
6
Jump to solution
08-20-2014 02:55 AM
maximcouton
New Contributor III

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,

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
maximcouton
New Contributor III

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.

View solution in original post

0 Kudos
6 Replies
by Anonymous User
Not applicable

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

0 Kudos
maximcouton
New Contributor III

Hi,

When I enter  http://localhost:8080/Java/proxy.jsp?http://services.arcgisonline.com/ArcGIS/rest/services/?f=pjson

It says :

The proxy.config file does not exist at application root, or is not readable.

0 Kudos
maximcouton
New Contributor III

Hi,Hi,

Hi,

it is now working  with tomcat, when typing the folowwing URL in the browser it forwads me the site

http://localhost:8080/Java/proxy.jsp?http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty...

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

0 Kudos
OwenEarley
Occasional Contributor III

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

Spatial XP

0 Kudos
maximcouton
New Contributor III

Hi thanks ,

My proxy.config is configured like you suggested, but still doesn't work. still  forbiden acces to

http://localhost:8080/Java/proxy.jsp?http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty...

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);

0 Kudos
maximcouton
New Contributor III

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.

0 Kudos