[Geoserver-devel] [JIRA] (GEOS-9756) Layer configured with missing style throws NPE

Peter Smythe created an issue

GeoServer / BugGEOS-9756

Layer configured with missing style throws NPE

Issue Type:

BugBug

Affects Versions:

2.17.2

Assignee:

Unassigned

Created:

30/Sep/20 8:54 PM

Environment:

Steps to reproduce:

Using the default install, rename pophatch.xml to pophatch.xml.break and reload the configuration or restart GeoServer
Click Tile Caching > Tile Layers - throws:

org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [OddEvenItem [Component id = 8]]
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1848)

Caused by: java.lang.NullPointerException
at org.geoserver.gwc.layer.StyleParameterFilter.setLayer(StyleParameterFilter.java:197)
at org.geoserver.gwc.layer.TileLayerInfoUtil.checkAutomaticStyles(TileLayerInfoUtil.java:162)
at org.geoserver.gwc.layer.TileLayerInfoUtil.checkAutomaticStyles(TileLayerInfoUtil.java:140)
at org.geoserver.gwc.layer.GeoServerTileLayer.lambda$getPublishedInfo$0(GeoServerTileLayer.java:401)

Alternatively, Data > Layers > topp:states > Publishing - throws:

org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [Palette [Component id = extraStyles]]
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1848)

Caused by: java.lang.NullPointerException
at org.geoserver.wms.web.publish.StyleNameRenderer.getIdValue(StyleNameRenderer.java:20)
at org.apache.wicket.extensions.markup.html.form.palette.component.Recorder.initIds(Recorder.java:107)

Priority:

MediumMedium

Reporter:

Peter Smythe

This is due to a layer (in this case topp:states) pointing to a style (pophatch) that no longer exists when the configuration is read from disk/catalog.

Unfortunately there are no logs that indicate which layer causes this problem and I had to view the Publishing page of each configured layer in order to determine which layer was at fault.

Saving the layer (on any tab other than Publishing) fixes the problem on disk, so the next time GeoServer reloads the problem is fixed.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100147-sha1:3ed3880)

Atlassian logo

Can I please ask you developers:

What would the best approach to fixing this be?

  • Upon loading the configuration, automatically remove a null style if the file (pophatch.xml) cannot be found/read - perhaps with a warning in a log file?

  • Give the user an explicit error message when rendering the UI and a null style is found?

Thanks

Peter

On Wed, 30 Sep 2020 at 20:57, Peter Smythe (JIRA) <jira@anonymised.com> wrote:

Peter Smythe created an issue

GeoServer / BugGEOS-9756

Layer configured with missing style throws NPE

Issue Type:

BugBug

Affects Versions:

2.17.2

Assignee:

Unassigned

Created:

30/Sep/20 8:54 PM

Environment:

Steps to reproduce:

Using the default install, rename pophatch.xml to pophatch.xml.break and reload the configuration or restart GeoServer
Click Tile Caching > Tile Layers - throws:

org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [OddEvenItem [Component id = 8]]
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1848)

Caused by: java.lang.NullPointerException
at org.geoserver.gwc.layer.StyleParameterFilter.setLayer(StyleParameterFilter.java:197)
at org.geoserver.gwc.layer.TileLayerInfoUtil.checkAutomaticStyles(TileLayerInfoUtil.java:162)
at org.geoserver.gwc.layer.TileLayerInfoUtil.checkAutomaticStyles(TileLayerInfoUtil.java:140)
at org.geoserver.gwc.layer.GeoServerTileLayer.lambda$getPublishedInfo$0(GeoServerTileLayer.java:401)

Alternatively, Data > Layers > topp:states > Publishing - throws:

org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [Palette [Component id = extraStyles]]
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1848)

Caused by: java.lang.NullPointerException
at org.geoserver.wms.web.publish.StyleNameRenderer.getIdValue(StyleNameRenderer.java:20)
at org.apache.wicket.extensions.markup.html.form.palette.component.Recorder.initIds(Recorder.java:107)

Priority:

MediumMedium

Reporter:

Peter Smythe

This is due to a layer (in this case topp:states) pointing to a style (pophatch) that no longer exists when the configuration is read from disk/catalog.

Unfortunately there are no logs that indicate which layer causes this problem and I had to view the Publishing page of each configured layer in order to determine which layer was at fault.

Saving the layer (on any tab other than Publishing) fixes the problem on disk, so the next time GeoServer reloads the problem is fixed.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100147-sha1:3ed3880)

Atlassian logo

_______________________________________________ Geoserver-devel mailing list [Geoserver-devel@lists.sourceforge.net](mailto:Geoserver-devel@lists.sourceforge.net) [https://lists.sourceforge.net/lists/listinfo/geoserver-devel](https://lists.sourceforge.net/lists/listinfo/geoserver-devel)