We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

24

Edit the webapps/geoserver/WEB-INF/web.xml file. There are two references to CORS in this file: <!-- Uncomment following filter to enable CORS --> <filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> </filter> and <!-- Uncomment ...


8

Unfortunate, what you are experiencing, is expected behavior, and not a Bug. Once you add an Image from an external domain, or cross-domain, and use it on the canvas, the canvas becomes "tainted" and the browser will not allow you to pull data out of it. The only solution for this is two step: Proper headers need to be sent by the server, which is sending ...


6

It will work if you add the filter in "geoserver/webapp/geoserver/WEB-INF/web.xml" and if you add the jar "jetty-servlets.9.2.13.v20150730.jar" inside "geoserver/webapp/geoserver/WEB-INF/lib"


6

If you are hosting your map server, It simply depends of your WMS server deployment and sofware but it's not set by default. For MapServer, it can be deployed with Apache, Lighthttpd, or Nginx. For GeoServer, you should avoid the default Jetty (version 6 too old, need to hack to set proper CORS headers) but use instead Jetty 7, TomCat or JBoss. It's also ...


5

We had the same issue, after enabling CORS by removing the comments in web.xml original file supplied with GeoServer, GeoServer was no longer starting properly in any configuration (we tried using Mac OS X installer, with the platform independent binary and using Apache/Tomcat). Finally, we managed to get the configuration to work using Apache/Tomcat but ...


4

You shouldn't worry about this error. The ESRI JSAPI is just testing whether the server at services.arcgisonline.com supports CORS. It currently doesn't support CORS, and hence the JSAPI throws an error in the console. This error doesn't indicate any problem at all. Most of your users will never see this error, and you shouldn't worry about it. If you are ...


4

Read the message! No 'Access-Control-Allow-Origin' header is present on the requested resource. The response had HTTP status code 404. You got a "404 Not Found" error from the tile server because openstreetmap.org does not serve tiles on levels higher than 19. openstreetmap.org does not include a "Access-Control-Allow-Origin" header when ...


3

with Jetty9, UbuntuServer 16.04, i also had to modify /etc/jetty9/start.ini, so as not to get the following error : 2018-03-31 15:10:01.769:WARN:oejuc.AbstractLifeCycle:main: FAILED cross-origin: javax.servlet.UnavailableException: org.eclipse.jetty.servlets.CrossOriginFilter javax.servlet.UnavailableException: org.eclipse.jetty.servlets.CrossOriginFilter ...


3

I was having the same exact problem. What finally worked for me is adding the following to the ROOT site and NOT the application for the web adapter. Does it make sense? Not to me. But it worked for me. <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpProtocol> <customHeaders> ...


3

Have you check jar file in : WEB-INF/lib/jetty-servlets*.jar (not 'jetty-servlet'!) If you don't have You can download in here. and You can check your Jetty version in : [GEOSERVER_HOME]/lib


3

You don't need Mapproxy in particular. Any web server can manage CORS as long as you configure it correctly (see http://enable-cors.org for more info). You should also play with option crossOrigin, directly available in ol.source.XYZ to deal with your CORS issue. You can also use the following code to manage Stamen layers instead of using ol.source.XYZ. ...


3

From http://permalink.gmane.org/gmane.comp.gis.geoserver.user/42219 Put content of this archive http://shanbe.hezoun.com/cors.zip into the \webapps\geoserver\WEB-INF\classes folder. use <filter-class>org.mortbay.servlets.CrossOriginFilter</filter-class> insteand of <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-...


2

Just to mention, Geoserver recently release 2.9-RC1, which comes with the more updated jetty (v9+) that supports CORS. Similar to the one mentioned by Ahmed GIS, you need to download the correct version of the jetty servlets. But this time, it is to copy into the directory "\WEB-INF\lib", and to edit the file "WEB-INF\web.xml" instead.


2

fwiw enable-cors.org is a great general resource for server or client configurations, in case you are deploying with Tomcat, for example.


2

I know you post this question from along time but i'm just solve the problem. I faced the same problem myself and i tried many solutions that discussed here or in other forums and finally i managed to solve the problem of enabling the Cross Origin in Geoserver. After many trials i discovered that the solution is pretty simple following the exact steps that ...


2

This is a java-script running in a web browser issue. Web browsers can only send requests over port 80 or 443. Which are http and https. So sending a request to port 6080 will not work. I would just setup the ArcGIS Web Adaptor on your local. That acts as a software proxy.


2

i can't find a link to share right now, but as of 10.1 the self contained installation of ArcGIS Server which is typically accessible on port 6080 is CORS enabled by default (the installation also gives you the option of laying down crossdomain and clientaccesspolicy.xml files to support the same in Flex and Silverlight). if you install the web adaptor on ...


2

When communicating to a service using the Esri Javascript API, a proxy page will only avoid CORS issues if the proxy page uses the same URL prefix as the original web site. So, if your web site is http://localhost:12345/path/to/index.html, the request to: http://111.111.111.111:6969/agsproxy/proxy.ashx?http://111.111.111.111:6969/ags/rest/services/VSLP2014/...


2

The problem got resolved. The actual error was 2 things as described below. Error 1 : The URL for accessing SQL API was wrong. The Correct URL is "http://development.localhost.lan:8080/api/v1/sql" Error 2 : The access to the dataset was private. When I change to "public" I could access the query result. But I am not sure why the private dataset is not ...


2

It seems that the version of Jetty being shipped with GeoServer 2.15 now includes the required jetty-servlets-x.jar and it becomes confused if you add another copy to the class path. I'm not sure if this is a change to Jetty or just to the version GeoServer packages. So the fix is to delete webapps/geoserver/WEB-INF/lib/jetty-servlets-9.4.12.v20180830.jar ...


2

WMS is requesting an image so there is no CORS issue. When you request a WFS feature collection the browser is more worried and needs you to handle CORS correctly.


1

If you are using tomcat then any reference to jetty is a red herring. Try following these instructions for tomcat.


1

You need to enable CORS in the servlet engine (Jetty, Tomcat?) that is running GeoServer. You will also need to set the proxy url on the global settings page to reflect the external server address (IIS) otherwise the URLs in the GetCapabilities responses will be wrong.


1

The SQL API works for private dataset too when the api_key is sent along with the URL without any spaces in the URL as below. http://development.localhost.lan:8080/api/v2/sql?q=SELECT * FROM tablename&api_key=1a77a491a96dff1c380fc869498587db105c5b65


1

You need to enable uploads on the geoprocessing service. You can enable this when publishing, or after the fact through the service properties. Check the Capabilities tab for the check box to enable it.


1

The GeoServer REST API is used purely for management of the GeoServer instance and should not be confused with the ESRI Rest interface. If you want to interrogate GeoServer about layers you need to use one of the OGC open standard interfaces provided. WMS - for rendered maps WFS - for vector features WCS - for raster coverages In each case there is a well ...


1

finally found the problem after digging through the error logs was nothing more than a comment in the web.xml file that had more than two dashes (even though the line was commented out as expected) ..oof, lesson learned...


1

My assumption are you are using jetty geoserver (installer) and you have your application on tomcat7 which is accessing WMS. In this situation a better solution is to deploy the geoserver war file in tomcat7 . This solves the root problem you won't need CORS at all ! Update : the problem seems to be in url format check this for more reference http://...


1

This could be caused by a known issue due to the length of the request, which is limited by those browsers. In order to avoid this issue, you could: Try reducing the CartoCSS code or the number of elements filtered in the zipcodes. Try using several layers instead of sublayers: this way the request of the layergroup will be shorter I think this last ...


1

For GeoServer 2.8 I resolve by this procedure: http://2carto.com/enable-cors-domain-geoserver-2-8/#comment-53 I tried implement to GeoServer 2.9 but can't resolve this problem so I re-installed GeoServer 2.8 and works.


Only top voted, non community-wiki answers of a minimum length are eligible