Uploaded image for project: 'GeoServer'
  1. GeoServer
  2. GEOS-7995

NULL pointer exception when using JMS plugin and updating a layer resource using REST

    Details

      Description

      To reproduce this problem create a JMS cluster and update in one of the master nodes a layer resource using REST, for example updating the provided tiger_roads layer resource:

      curl -u admin:geoserver -H "Content-Type:application/json" -X PUT -d '{"featureType": {"abstract": "UPDATE ABSTRACT"}}' http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/tiger_roads.json
      

      The update will be correctly propagated in all the nodes, but performing a get map request on the slaves with the updated layer will provoke a NULL pointer exception.

      Note that when updating the layer resource using GeoServer UI this error doesn't happen.

      This issue happens only with the REST PUT operation because the REST PUT operation copies all the fields of the updated object to the existing object:
      https://github.com/geoserver/geoserver/blob/master/src/ows/src/main/java/org/geoserver/ows/util/OwsUtils.java#L315-L354

      So even fields that are no updated like the catalog will be considered updated by the modification proxy and send for alteration to the slave nodes. Since some of the catalog fields are transient the salves will update the resource instance with an invalid catalog object.

      To fix this issue the catalog deserializer should ignore any received property of type catalog.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: