Moving this to the user list for discussion.
I tend to use grep in the data directory to search for the identifier when
fixing this sort of issue by hand.

A lot of the code (rendering in this instance) needs to trust that the data
structure is filled in correctly (in this case that a value is supplied).

The correct place to catch this is when the problem is introduced (reading
an invalid configuration), rather than in all the many places that
reference this data structure.

Q: Why would you rename pophatch.xml to pophatch.xml.break ?
--
Jody Garnett


On Wed, 30 Sep 2020 at 12:06, Peter Smythe <[email protected]> wrote:

> 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) <
> [email protected]> wrote:
>
>> Peter Smythe
>> <https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b3b4ba74e83c12dd31159d6>
>> *created* an issue
>>
>> GeoServer
>> <https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiYjI1MWRjZDczNzdkNDcxNzlmOTg1ODBlYzQ3NjY4MGIiLCJwIjoiaiJ9>
>> / [image: Bug]
>> <https://osgeo-org.atlassian.net/browse/GEOS-9756?atlOrigin=eyJpIjoiYjI1MWRjZDczNzdkNDcxNzlmOTg1ODBlYzQ3NjY4MGIiLCJwIjoiaiJ9>
>> GEOS-9756
>> <https://osgeo-org.atlassian.net/browse/GEOS-9756?atlOrigin=eyJpIjoiYjI1MWRjZDczNzdkNDcxNzlmOTg1ODBlYzQ3NjY4MGIiLCJwIjoiaiJ9>
>> Layer configured with missing style throws NPE
>> <https://osgeo-org.atlassian.net/browse/GEOS-9756?atlOrigin=eyJpIjoiYjI1MWRjZDczNzdkNDcxNzlmOTg1ODBlYzQ3NjY4MGIiLCJwIjoiaiJ9>
>> Issue Type: [image: Bug] Bug
>> 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: [image: Medium] Medium
>> Reporter: Peter Smythe
>> <https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b3b4ba74e83c12dd31159d6>
>>
>> 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.
>> [image: Add Comment]
>> <https://osgeo-org.atlassian.net/browse/GEOS-9756#add-comment?atlOrigin=eyJpIjoiYjI1MWRjZDczNzdkNDcxNzlmOTg1ODBlYzQ3NjY4MGIiLCJwIjoiaiJ9>
>>  Add
>> Comment
>> <https://osgeo-org.atlassian.net/browse/GEOS-9756#add-comment?atlOrigin=eyJpIjoiYjI1MWRjZDczNzdkNDcxNzlmOTg1ODBlYzQ3NjY4MGIiLCJwIjoiaiJ9>
>>
>> Get Jira notifications on your phone! Download the Jira Cloud app for
>> Android
>> <https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail>
>> or iOS
>> <https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8>
>> ------------------------------
>> This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100147-
>> sha1:3ed3880)
>> [image: Atlassian logo]
>> _______________________________________________
>> Geoserver-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to