[Geoserver-users] Updating (PUT) a featuretype using the REST-interface results in the featuretype being disabled on disk

Hi all,

Using the REST interface, we update the bbox of a featuretype we recently created like this (pseudo code):

request_url = ‘/geoserver/rest/workspaces/someworkspace/datastores/somedatastore/featuretypes/somelayer’
xml = ‘somelayer’
request_url = request_url + ‘?recalculate=nativebbox,latlonbbox’
response = requests.put(request_url, data=xml)

This causes the featuretype to be disabled on disk, but enabled in memory. As a consquence, the layer disappears after restarting the server.

Only when we explicitly add true, the corrrect behaviour is observed.

Has anyone found this issue? Is a required field? Or is this a bug in GeoServer. We tried locating the serializer which writes the XML to disk, but were unsuccesful. If someone knows is, we’ll try our best at creating a pull request.

Thanks in advance,

Erik-Jan Vos - Nelen & Schuurmans B.V.
Sander Smits - Nelen & Schuurmans B.V.

On Wed, May 1, 2013 at 2:57 PM, Erik-Jan Vos <
erikjan.vos@anonymised.com> wrote:

Hi all,

Using the REST interface, we update the bbox of a featuretype we recently
created like this (pseudo code):

        request_url =
'/geoserver/rest/workspaces/someworkspace/datastores/somedatastore/featuretypes/somelayer'
        xml = '<featureType><name>somelayer</name></featureType>'
        request_url = request_url + '?recalculate=nativebbox,latlonbbox'
        response = requests.put(request_url, data=xml)

This causes the featuretype to be disabled on disk, but enabled in memory.
As a consquence, the layer disappears after restarting the server.

Only when we explicitly add <enabled>true</enabled>, the corrrect
behaviour is observed.

Has anyone found this issue? Is <enabled> a required field? Or is this a
bug in GeoServer. We tried locating the serializer which writes the XML to
disk, but were unsuccesful. If someone knows is, we'll try our best at
creating a pull request.

It is a well known issue. Justin may be able to comment on this one... also
search the mailing list archives, there might already be something in it.

Cheers
Andrea

--

GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Yes it is a known issue:

https://jira.codehaus.org/browse/GEOS-3964

···

On Wed, May 1, 2013 at 7:51 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Wed, May 1, 2013 at 2:57 PM, Erik-Jan Vos <erikjan.vos@anonymised.com> wrote:

Hi all,

Using the REST interface, we update the bbox of a featuretype we recently created like this (pseudo code):

request_url = ‘/geoserver/rest/workspaces/someworkspace/datastores/somedatastore/featuretypes/somelayer’
xml = ‘somelayer’
request_url = request_url + ‘?recalculate=nativebbox,latlonbbox’
response = requests.put(request_url, data=xml)

This causes the featuretype to be disabled on disk, but enabled in memory. As a consquence, the layer disappears after restarting the server.

Only when we explicitly add true, the corrrect behaviour is observed.

Has anyone found this issue? Is a required field? Or is this a bug in GeoServer. We tried locating the serializer which writes the XML to disk, but were unsuccesful. If someone knows is, we’ll try our best at creating a pull request.

It is a well known issue. Justin may be able to comment on this one… also search the mailing list archives, there might already be something in it.

Cheers
Andrea

==
GeoServer training in Milan, 6th & 7th June 2013! Visit http://geoserver.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it