[Geoserver-users] cannot get layers to display in webapp on localhost

Sorry that I’m reposting, but the message in the archive didn’t have any body text.

I’m in the middle of a prototype migration/deployment and have really hit a wall serving up my layers from geoserver. I’ve geoserver running from the “stand-alone” version running in jetty on one port and the webapp running in tomcat on another port. The webapp requests data from geoserver via localhost. This setup works fine on my laptop where I initially developed the prototype. Since moving everything to a server on the intranet, the webapp can request layers from geoserver, geoserver handles the request, and the webapp never gets anything returned. What’s even stranger, is if the prototype’s code is run a other hosts and requests data from the aforementioned geoserver, it gets data just fine. The webapp can successfully access remote WMS layers directly (not from, or cascaded by, my geoserver).

The laptop is running geoserver 2.3.0 and tomcat 7, both from an openSuSE 13.2 rpms, and Oracle’s java 1.7.0_79.
The server is running geoserver 2.7.2 (downloaded), and tomcat 7 and OpenJDK 1.7.0_85 from CentOS 7 rpms.

Any help will be much appreciated.

-B-

Is this like a cross origon configuration issue with your webapp?

···

On 1 September 2015 at 08:50, Scott Brunza <scottso@anonymised.com> wrote:

Sorry that I’m reposting, but the message in the archive didn’t have any body text.

I’m in the middle of a prototype migration/deployment and have really hit a wall serving up my layers from geoserver. I’ve geoserver running from the “stand-alone” version running in jetty on one port and the webapp running in tomcat on another port. The webapp requests data from geoserver via localhost. This setup works fine on my laptop where I initially developed the prototype. Since moving everything to a server on the intranet, the webapp can request layers from geoserver, geoserver handles the request, and the webapp never gets anything returned. What’s even stranger, is if the prototype’s code is run a other hosts and requests data from the aforementioned geoserver, it gets data just fine. The webapp can successfully access remote WMS layers directly (not from, or cascaded by, my geoserver).

The laptop is running geoserver 2.3.0 and tomcat 7, both from an openSuSE 13.2 rpms, and Oracle’s java 1.7.0_79.
The server is running geoserver 2.7.2 (downloaded), and tomcat 7 and OpenJDK 1.7.0_85 from CentOS 7 rpms.

Any help will be much appreciated.

-B-



Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Jody Garnett

Yes it is.

I am getting now

“Uncaught SecurityError: Failed to execute ‘getImageData’ on ‘CanvasRenderingContext2D’: The canvas has been tainted by cross-origin data.”

Thanks.

JJ.

From: Jody Garnett [mailto:jody.garnett@anonymised.com]
Sent: Tuesday, September 1, 2015 2:17 PM
To: Scott Brunza <scottso@anonymised.com>
Cc: GeoServer Users <geoserver-users@lists.sourceforge.net>
Subject: Re: [Geoserver-users] cannot get layers to display in webapp on localhost

Is this like a cross origon configuration issue with your webapp?

Jody Garnett

On 1 September 2015 at 08:50, Scott Brunza <scottso@anonymised.com> wrote:

Sorry that I’m reposting, but the message in the archive didn’t have any body text.

I’m in the middle of a prototype migration/deployment and have really hit a wall serving up my layers from geoserver. I’ve geoserver running from the “stand-alone” version running in jetty on one port and the webapp running in tomcat on another port. The webapp requests data from geoserver via localhost. This setup works fine on my laptop where I initially developed the prototype. Since moving everything to a server on the intranet, the webapp can request layers from geoserver, geoserver handles the request, and the webapp never gets anything returned. What’s even stranger, is if the prototype’s code is run a other hosts and requests data from the aforementioned geoserver, it gets data just fine. The webapp can successfully access remote WMS layers directly (not from, or cascaded by, my geoserver).

The laptop is running geoserver 2.3.0 and tomcat 7, both from an openSuSE 13.2 rpms, and Oracle’s java 1.7.0_79.

The server is running geoserver 2.7.2 (downloaded), and tomcat 7 and OpenJDK 1.7.0_85 from CentOS 7 rpms.

Any help will be much appreciated.

-B-



Geoserver-users mailing list
Geoserver-users@anonymised.comceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Jody Garnett

Here is an article on same-origin policy -

There are two traditional options:

a) Set up a proxy - so geoserver appears to be served from your web server (this is why we have the base url setting in geoserver)
b) fiddle with CORS headers and allow cross domain scripting …

Hopefully someone here will know more :slight_smile:

···

On 1 September 2015 at 17:02, Jair Santos <jsantos5954@anonymised.com> wrote:

Yes it is.

I am getting now

“Uncaught SecurityError: Failed to execute ‘getImageData’ on ‘CanvasRenderingContext2D’: The canvas has been tainted by cross-origin data.”

Thanks.

JJ.

From: Jody Garnett [mailto:jody.garnett@anonymised.com]
Sent: Tuesday, September 1, 2015 2:17 PM
To: Scott Brunza <scottso@anonymised.com>
Cc: GeoServer Users <geoserver-users@anonymised.comet>
Subject: Re: [Geoserver-users] cannot get layers to display in webapp on localhost

Is this like a cross origon configuration issue with your webapp?

Jody Garnett

On 1 September 2015 at 08:50, Scott Brunza <scottso@anonymised.com…> wrote:

Sorry that I’m reposting, but the message in the archive didn’t have any body text.

I’m in the middle of a prototype migration/deployment and have really hit a wall serving up my layers from geoserver. I’ve geoserver running from the “stand-alone” version running in jetty on one port and the webapp running in tomcat on another port. The webapp requests data from geoserver via localhost. This setup works fine on my laptop where I initially developed the prototype. Since moving everything to a server on the intranet, the webapp can request layers from geoserver, geoserver handles the request, and the webapp never gets anything returned. What’s even stranger, is if the prototype’s code is run a other hosts and requests data from the aforementioned geoserver, it gets data just fine. The webapp can successfully access remote WMS layers directly (not from, or cascaded by, my geoserver).

The laptop is running geoserver 2.3.0 and tomcat 7, both from an openSuSE 13.2 rpms, and Oracle’s java 1.7.0_79.

The server is running geoserver 2.7.2 (downloaded), and tomcat 7 and OpenJDK 1.7.0_85 from CentOS 7 rpms.

Any help will be much appreciated.

-B-



Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Jody Garnett


Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Jody Garnett

Thanks Jody.

Based on what I read so far, the best option is CORS. I guess that the change I’ve made in web.config is enough in the server side. I think I need now to create code in the client. If someone can help is going to be awesome.

If I figure it out, I’ll post here what I find.

JJ.

From: Jody Garnett [mailto:jody.garnett@anonymised.com]
Sent: Tuesday, September 1, 2015 5:09 PM
To: Jair Santos jsantos5954@anonymised.com
Cc: GeoServer Mailing List List geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] cannot get layers to display in webapp on localhost

Here is an article on same-origin policy -

There are two traditional options:

a) Set up a proxy - so geoserver appears to be served from your web server (this is why we have the base url setting in geoserver)

b) fiddle with CORS headers and allow cross domain scripting …

Hopefully someone here will know more :slight_smile:

Jody Garnett

On 1 September 2015 at 17:02, Jair Santos <jsantos5954@…84…> wrote:

Yes it is.

I am getting now

“Uncaught SecurityError: Failed to execute ‘getImageData’ on ‘CanvasRenderingContext2D’: The canvas has been tainted by cross-origin data.”

Thanks.

JJ.

From: Jody Garnett [mailto:jody.garnett@anonymised.com]
Sent: Tuesday, September 1, 2015 2:17 PM
To: Scott Brunza <scottso@anonymised.com…>
Cc: GeoServer Users <geoserver-users@anonymised.comrge.net>
Subject: Re: [Geoserver-users] cannot get layers to display in webapp on localhost

Is this like a cross origon configuration issue with your webapp?

Jody Garnett

I think I’ll need to take you up on the CORS info since I’ve not made any head way yet. Using tomcat’s org.apache.catalina.filters.CorsFilter filter didn’t work. I can get around the problem by specifying the URL to geoserver with the IP instead of localhost. We should probably continue outside the list, and I can post the solution when complete.

-B-

On Sep 2, 2015, at 11:06 AM, Jair Santos <jsantos5954@anonymised.com> wrote:

Hi Scott,

I’ve been replying to one person only all the time, and Jody keep remind me to reply to the list so everybody can follow and benefit from our research in the future. That’s my turn to remind someoneJ.

I’ll be very happy to work and share information about CORS, since it is an important piece of my work at this time.

Cheers.

JJ.

--- Let us all bask in television’s warm glowing warming glow ---
Scott Brunza 860.326.3637 scottso@anonymised.com

This e-mail and any files transmitted with it may be proprietary
and are intended solely for the use of the individual or entity
to whom they are addressed. If you have received this e-mail in
error, please notify the sender.