Request URL length issues with Jetty

For quite some time a couple of us were banging our heads on a problem using OpenLayers and GeoServer – we had a map which we had applied a filter to so it would only render certain features, and we were allowing users to click on those features to get information about them.

Unfortunately, the request URL for the GetFeatureInfo request (which returns information about features close to a mouse click) was too long and we would get a pop-up without any information in it and a java.io.IOException: FULL head from Jetty. If we removed the filter (which was fairly long) from the request’s parameters, clicking on rendered features would work, but you could also click on unrendered features, because there was no longer a filter!

We had faced this problem before, in passing the filter to the map page itself. This was easy to solve, because newer versions of OpenLayers support passing parameters as a POST, which cut down the URL size. So we dug in to the source code and found that there was no apparent way to make this particular request into a POST, and our attempts to make our own way to do this proved unsuccessful. We were feeling pretty stuck.

Until we noticed that this problem only occurred when we were testing on Eclipse – on the demo server, the filter worked perfectly. Running out of Eclipse meant that the application was running via Jetty, and running on demo meant that we were using Tomcat. It appears that Jetty was not tolerating the long URLs, while Tomcat had no problem whatsoever with them. In fact, while playing around with the parameters I was unable to reproduce the issue at all on Tomcat.

This meant that while we were trying, and failing, to sort the problem out while running on Jetty, because the problem only existed using Jetty! In summary: Tomcat is a lot more forgiving about URL length than Jetty is.

 

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply