[Geoserver-devel] [JIRA] (GEOS-7995) NULL pointer exception when using JMS plugin and updating a layer resource using REST

Nuno Oliveira created an issue

GeoServer / BugGEOS-7995

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

Issue Type:

BugBug

Assignee:

Nuno Oliveira

Components:

Community modules

Created:

14/Feb/17 5:18 PM

Priority:

MediumMedium

Reporter:

Nuno Oliveira

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:8075/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.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.747.1#100028-sha1:3d05bd6)

Atlassian logo