We're updating the issue view to help you get more done. 

Virtual WMTS: Layer is not known

Description

When working with virtual workspace service WMTS, that is, something like:

http://localhost:8080/geoserver/myworkspace/gwc/service/wmts?SERVICE=WMTS&...

layer are sent in capabilities without workspace prefix:

GeoServerTileLayer.java

1 2 3 4 5 6 7 8 9 10 11 @Override public String getName() { // getting the current gwc operation String gwcOperation = GwcServiceDispatcherCallback.GWC_OPERATION.get(); // checking if we are in the context of a get capabilities request if (gwcOperation != null && gwcOperation.equalsIgnoreCase("GetCapabilities")) { // this is a get capabilities request, we need to check if we are in the context of virtual service return getNoPrefixedNameIfVirtualService(); } return info.getName(); }

However, when processing GetFeaturetInfo, layer name with workspace prefix is required, otherwise you get a 400 error: LAYER xxxx is not known.

WMTSService.java

1 2 3 4 5 6 7 8 9 10 11 12 13 String layer = values.get("layer"); if (layer == null) { throw new OWSException(400, "MissingParameterValue", "LAYER", "Missing LAYER parameter"); } TileLayer tileLayer = null; try { tileLayer = tld.getTileLayer(layer); } catch (GeoWebCacheException e) { throw new OWSException(400, "InvalidParameterValue", "LAYER", "LAYER " + layer + " is not known."); }

Prefix must be applied in this case for the virtual service to work.

Environment

None

Status

Assignee

Unassigned

Reporter

Eduardo Suarez-Santana

Triage

Fix versions

None

Affects versions

2.10.1

Components

Priority

Medium