[Geoserver-users] Direct GWC integration and CQL FILTER.... [SEC=UNOFFICIAL]

Hi!

I’m using GeoServer 2.4.4 (GeoWebCache v1.5.0).

I’m currently serving a layer of point (latitude/longitude) data from a PostGIS table and have enabled direct integration GWC caching. This all works a treat when no CQL filter is supplied…

My (generated) GWC layer configuration file is…

LayerInfoImpl-43ac45ed:143e39ae9ed:-7ffa

true

sentinel:hotspot_current

image/jpeg

image/png

EPSG:900913

EPSG:4326

4

4

STYLES

sentinel-legacy

0

Requesting a tile and looking at the result in FireBug gives me…

http://host:port/geoserver/blah/wms?LAYERS=blah_layer&TILED=true&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A3857&BBOX=15028131.255,-5009377.085,17532819.7975,-2504688.5425&WIDTH=256&HEIGHT=256

Response Headers



Cache-Control



max-age=600



Content-Disposition



inline; filename=blah_blah.png



Content-Type



image/png



Date



Mon, 10 Feb 2014 02:53:22 GMT



Etag



8528c0ee4f3307e0a303a2949d671801



Last-Modified



Mon, 10 Feb 2014 02:52:53 GMT



Server



Apache-Coyote/1.1



Transfer-Encoding



chunked



geowebcache-cache-result



HIT



geowebcache-crs



EPSG:900913



geowebcache-gridset



EPSG:900913



geowebcache-layer



blah:blah_layer



geowebcache-tile-bounds



15028131.254999999,-5009377.085000001,17532819.797500003,-2504688.5425000004



geowebcache-tile-index



[14, 6, 4]

Beautiful.

If I then add a CQL FILTER to my request it, as expected, misses the cache due to the CQL FILTER…

http://host:port/geoserver/blah/wms?LAYERS=blah_layer&TILED=true&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A3857&CQL_FILTER=a=‘a’&BBOX=15028131.255,-5009377.085,17532819.7975,-2504688.5425&WIDTH=256&HEIGHT=256

Response Headers



Cache-Control



max-age=600, must-revalidate



Content-Disposition



inline; filename=blah_blah.png



Content-Type



image/png



Date



Mon, 10 Feb 2014 02:57:59 GMT



Expires



Mon, 10 Feb 2014 03:07:59 GMT



Server



Apache-Coyote/1.1



Transfer-Encoding



chunked



geowebcache-cache-result



MISS



geowebcache-miss-reason



no parameter filter exists for CQL_FILTER

So, I added a CQL FILTER parameter which added the following to my GWC layer configuration…

STYLES

sentinel-legacy

CQL_FILTER

^(.*)$

But when I try my request again it now misses the cache complaining about the FILTER parameter…

Response Headers



Cache-Control



max-age=600, must-revalidate



Content-Disposition



inline; filename=blah_blah.png



Content-Type



image/png



Date



Mon, 10 Feb 2014 03:08:53 GMT



Expires



Mon, 10 Feb 2014 03:18:53 GMT



Server



Apache-Coyote/1.1



Transfer-Encoding



chunked



geowebcache-cache-result



MISS



geowebcache-miss-reason



no parameter filter exists for FILTER

If I similarly add a parameter for FILTER (even though I’m not explicitly sending it?) then my config file now gets…

STYLES

sentinel-legacy

FILTER

^(.*)$

CQL_FILTER

^(.*)$

But when I try my request again then I get an exception…

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

java.lang.NullPointerException

null

And in my geoserver log file….

2014-02-10 14:13:07,280 ERROR [geoserver.ows] -

java.lang.NullPointerException

at java.util.regex.Matcher.getTextLength(Matcher.java:1234)

at java.util.regex.Matcher.reset(Matcher.java:308)

at java.util.regex.Matcher.(Matcher.java:228)

at java.util.regex.Pattern.matcher(Pattern.java:1088)

at org.geowebcache.filter.parameters.RegexParameterFilter.getMatcher(RegexParameterFilter.java:49)

at org.geowebcache.filter.parameters.RegexParameterFilter.applies(RegexParameterFilter.java:87)

at org.geoserver.gwc.GWC.filterApplies(GWC.java:884)

at org.geoserver.gwc.GWC.isCachingPossible(GWC.java:823)

at org.geoserver.gwc.GWC.prepareRequest(GWC.java:647)

at org.geoserver.gwc.GWC.dispatch(GWC.java:631)

at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:83)

at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:54)

Any clues on what I am doing wrong?

Thanks heaps!

Simon Oldfield
National Earth Observation Group | Environmental Geoscience Division | GEOSCIENCE AUSTRALIA

__________________________________________________****__________

Phone: +61 2 6249 9589 Fax: +61 2 6249 9999

Email: Simon.Oldfield@anonymised.com Web: www.ga.gov.au

Cnr Jerrabomberra Avenue and Hindmarsh Drive Symonston ACT

GPO Box 378 Canberra ACT 2601 Australia

Applying geoscience to Australia’s most important challenges

Geoscience Australia Disclaimer: This e-mail (and files transmitted with it) is intended only for the person or entity to which it is addressed. If you are not the intended recipient, then you have received this e-mail by mistake and any use, dissemination, forwarding, printing or copying of this e-mail and its file attachments is prohibited. The security of emails transmitted cannot be guaranteed; by forwarding or replying to this email, you acknowledge and accept these risks.