Hello
I am trying to create with the REST API a layer group composed of:
- a reference to another layer group, using the default style of the layer group
- a reference to a WMS Remote layer, using the default style of the remote layer
I managed to create it in the admin UI. I used the REST API to get the definition of this layer group. The default style is indicated by an empty style element in the style list.
I tried to create the same group (after deleting it from geoserver) using the REST API and I get a 500 error. In the log, the stack complains because the style name is null (which is true since I didn’t provide it).
Is it a bug or is there a special syntax to manage the case ?
For my remote WMS layer, I can do a work around by using the name of the remote layer style. But for the layer group it is not possible, except if I create in my layer group a layer style with the same definition of my default one.
The layer stack:
java.lang.NullPointerException
at org.geoserver.catalog.SLDNamedLayerValidator.validate(SLDNamedLayerValidator.java:65)
at org.geoserver.catalog.impl.CatalogImpl.validate(CatalogImpl.java:1005)
at org.geoserver.security.SecureCatalogImpl.validate(SecureCatalogImpl.java:1270)
at org.geoserver.catalog.impl.AbstractFilteredCatalog.validate(AbstractFilteredCatalog.java:578)
at org.geoserver.catalog.impl.AbstractCatalogDecorator.validate(AbstractCatalogDecorator.java:547)
at org.geoserver.catalog.impl.LocalWorkspaceCatalog.validate(LocalWorkspaceCatalog.java:432)
at org.geoserver.rest.catalog.LayerGroupController.layerGroupPost(LayerGroupController.java:156)