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...
<GeoServerTileLayer>
<id>LayerInfoImpl-43ac45ed:143e39ae9ed:-7ffa</id>
<enabled>true</enabled>
<name>sentinel:hotspot_current</name>
<mimeFormats>
<string>image/jpeg</string>
<string>image/png</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:900913</gridSetName>
</gridSubset>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
</gridSubset>
</gridSubsets>
<metaWidthHeight>
<int>4</int>
<int>4</int>
</metaWidthHeight>
<parameterFilters>
<styleParameterFilter>
<key>STYLES</key>
<defaultValue></defaultValue>
<availableStyles class="sorted-set"/>
<defaultStyle>sentinel-legacy</defaultStyle>
</styleParameterFilter>
</parameterFilters>
<gutter>0</gutter>
</GeoServerTileLayer>
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...
<parameterFilters>
<styleParameterFilter>
<key>STYLES</key>
<defaultValue></defaultValue>
<availableStyles class="sorted-set"/>
<defaultStyle>sentinel-legacy</defaultStyle>
</styleParameterFilter>
<regexParameterFilter>
<key>CQL_FILTER</key>
<defaultValue></defaultValue>
<regex>^(.*)$</regex>
</regexParameterFilter>
</parameterFilters>
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...
<parameterFilters>
<styleParameterFilter>
<key>STYLES</key>
<defaultValue></defaultValue>
<availableStyles class="sorted-set"/>
<defaultStyle>sentinel-legacy</defaultStyle>
</styleParameterFilter>
<regexParameterFilter>
<key>FILTER</key>
<defaultValue></defaultValue>
<regex>^(.*)$</regex>
</regexParameterFilter>
<regexParameterFilter>
<key>CQL_FILTER</key>
<defaultValue></defaultValue>
<regex>^(.*)$</regex>
</regexParameterFilter>
</parameterFilters>
But when I try my request again then I get an exception...
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE
ServiceExceptionReport SYSTEM
"http://10.10.19.58:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1" > <ServiceException>
java.lang.NullPointerException
null
</ServiceException></ServiceExceptionReport>
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.<init>(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: [email protected] Web: www.ga.gov.au<http://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.
-------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users