[Geoserver-users] gwc: Cannot fetch tile with parameters if metastore is disabled

Hello,
I'm experimenting with geoserver 2.2.4 and the integrated geowebcache. I published a gwc layer via GUI interface and tried to cache tiles with direct wms requests.
Without parameters all work fine, but I need to use parameters, so I tried to configure the parameterFilters in the file gwc-layers/LayerGroupInfoImpl--4b52a7f3_13c8c6bb59a_-7eb2.xml (which was automatically generated by geoserver):

<parameterFilters>
           <stringParameterFilter>
               <key>viewparams</key>
               <defaultValue>lang:de</defaultValue>
               <values>
                   <string>lang:de</string>
                   <string>lang:en</string>
               </values>
           </stringParameterFilter>
</parameterFilters>

So I tested if the request goes through geowebcache:

curl -v "http://localhost:8083/geoserver/wms?LAYERS=mylayer&FORMAT=image%2Fpng&TILESORIGIN=382988.91775432,5201465.480606&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A32632&BBOX=383257.71775432,5201644.680606,383347.31775432,5201734.280606&WIDTH=256&HEIGHT=256&tiled=true&viewparams=lang:de&quot; > /dev/null

The problem is I can only request the parameter with the default value.
With viewparams=lang:de the request is processed by geowebcache and the tiles are generated because lang:de is the default value. If I try viewparams=lang:en geowebcache does not work with no errors in the curl output but with this error in the jetty log:
31 Jan 17:47:39 ERROR [storage.StorageBroker] - Cannot fetch tile with parameters if metastore is disabled!

Without defaultValue does not work at all.
mylayer is a layergroup and I'm using ubuntu 12.04.

Can anybody help me?

Thanks, Tommaso

On Thu, Jan 31, 2013 at 6:24 PM, tommaso <tommasodb@anonymised.com> wrote:

Hello,
I’m experimenting with geoserver 2.2.4 and the integrated geowebcache. I
published a gwc layer via GUI interface and tried to cache tiles with
direct wms requests.
Without parameters all work fine, but I need to use parameters, so I
tried to configure the parameterFilters in the file
gwc-layers/LayerGroupInfoImpl–4b52a7f3_13c8c6bb59a_-7eb2.xml (which was
automatically generated by geoserver):

This is completely normal, the metastore is what makes parameters work,
without it, you cannot have layer parameters, at least in the 2.2.x series.

The 2.3.x series on the other hand has no metastore anymore, and parameters
work just fine even without it

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Thanks for your reply. But how can I enable the metastore?
In the gwc datadir there is already a metastore database.

Regards, Tommaso

This is completely normal, the metastore is what makes parameters
work,
without it, you cannot have layer parameters, at least in the 2.2.x
series.

The 2.3.x series on the other hand has no metastore anymore, and
parameters
work just fine even without it

Cheers
Andrea

On Thu, Jan 31, 2013 at 7:37 PM, tommaso <tommasodb@anonymised.com> wrote:

Thanks for your reply. But how can I enable the metastore?
In the gwc datadir there is already a metastore database.

You don’t, you have to avoid disabling it instead.
Metastore is disabled normally in clustered installs, because of file locks
it’s not possible to have more than one GeoServer/GeoWebCache running against
the same data dir.

The metastore is disabled if the following system variable is set in the
JVM that runs GeoServer:
-DGWC_METASTORE_DISABLED=true

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


The problem was that the metastore database was corrupted. Deleting it
and restart geoserver solved the issue.

Thanks a lot, Tommaso

On Thu, 2013-01-31 at 20:35 +0100, Andrea Aime wrote:

On Thu, Jan 31, 2013 at 7:37 PM, tommaso <tommasodb@anonymised.com>
wrote:
        Thanks for your reply. But how can I enable the metastore?
        In the gwc datadir there is already a metastore database.

You don't, you have to avoid disabling it instead.
Metastore is disabled normally in clustered installs, because of file
locks
it's not possible to have more than one GeoServer/GeoWebCache running
against
the same data dir.

The metastore is disabled if the following system variable is set in
the
JVM that runs GeoServer:
-DGWC_METASTORE_DISABLED=true

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------