Uploaded image for project: 'GeoServer'
  1. GEOS-8073

Performing a WMTS GetCapabilities request with layer groups provokes a NPE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.12-beta
    • Component/s: GWC
    • Labels:
      None

      Description

      To reproduce this error just perform a WMTS get capabilities request where group layers are included, a NULL pointer exception will be throw (full stack trace attached):

      java.lang.NullPointerException
      	at java.util.HashMap.putMapEntries(HashMap.java:500)
      	at java.util.HashMap.putAll(HashMap.java:784)
      	at org.geowebcache.service.wmts.WMTSGetCapabilities.getLegendsInfo(WMTSGetCapabilities.java:516)
      

      This happens because GeoServer doesn't returns an empty map (default behavior of the overridden method) but instead NULL when no legends are available. This typically happens for layer groups which don't have legends associated.

      The line of code that does this:
      https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerTileLayer.java#L1277-L1280

      GWC code can also be made more robust by ignoring NULL values.

        Attachments

          Activity

            People

            • Assignee:
              nmco Nuno Oliveira
              Reporter:
              nmco Nuno Oliveira
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: