Ole originally contacted me directly about this issue since his message was
initially flagged as spam. Here's my response (which he reports resolved
the problem.)
--
David Winslow
OpenGeo - http://opengeo.org/
---------- Forwarded message ----------
From: David Winslow <dwins...@opengeo.org>
Date: Wed, Jan 26, 2011 at 12:03 PM
Subject: Re: Error auto-configuring coverage:Error persisting
CoverageInfoImpl
To: Ole Nielsen <ole.moller.niel...@gmail.com>
Hi Ole.
This is one of the rough edges of the REST API... When you upload a coverage
and let GeoServer autoconfigure it, it actually creates three objects in the
configuration system:
* A "coverage store" representing the connection to the data source, in this
case the geotiff file.
* A coverage resource representing the data inside of that datasource (for
some types of coverage data one store may contain multiple data layers,
hence the distinction. GeoServer's default install does not include any
coverage readers that can provide multiple data layers, however, so such
usage is infrequent.)
* A layer associating the data with a style, title, etc. for WMS usage.
You must delete the coveragestore before you can upload a new dataset with
the same name. BUT, GeoServer will not allow you to delete a coveragestore
which contains an active coverage. And it also won't allow you to delete a
coverage with an active layer.
Anyway, the fix is:
if you're using a recent GeoServer version (nightly build of 2.0.x or
2.1RC1) you can use a request like:
curl -u admin:geoserver -v -X DELETE "
http://localhost:8080/geoserver/rest/workspaces/hazard/coveragestores/shakemap_padang_20090930?recurse=true
"
This deletes the coveragestore, and all coverages it contains, and all
layers associated with those coverages. For older versions of GeoServer,
you will need to manage this yourself:
curl -u admin:geoserver -v -X DELETE "
http://localhost:8080/geoserver/rest/layers/shakemap_padang_20090930"
curl -u admin:geoserver -v -X DELETE "
http://localhost:8080/geoserver/rest/workspaces/hazard/coveragestores/shakemap_padang_20090930/coverages/shakemap_padang_20090930
"
curl -u admin:geoserver -v -X DELETE "
http://localhost:8080/geoserver/rest/workspaces/hazard/coveragestores/shakemap_padang_20090930
"
The order is important since if the layer exists, the coverage can't be
deleted, etc. You'll also need to remove the layer from any layergroups
that might contain it, if you are using layergroups.
Hope this helps.
--
David Winslow
OpenGeo - http://opengeo.org/
On Tue, Jan 25, 2011 at 2:24 AM, Ole Nielsen
<ole.moller.niel...@gmail.com>wrote:
> This bounced from the mailing list, but it'd fantastic if you could share
> your thoughts.
> Many thanks
> Ole Nielsen, AIFDR, Jakarta
>
>
> ---------- Forwarded message ----------
> From: Ole Nielsen <ole.moller.niel...@gmail.com>
> Date: Tue, Jan 25, 2011 at 2:20 PM
> Subject: Error auto-configuring coverage:Error persisting CoverageInfoImpl
> To: geoserver-users@lists.sourceforge.net
> Cc: ted.dunst...@aifdr.org, ortel...@gmail.com, nick.horsp...@gmail.com,
> r-w <r...@manontroppo.org>
>
>
> Hi all
>
> We are working on projects that use REST to communicate with GeoServer and
> have encountered the following error message:
>
> Error auto-configuring coverage:Error persisting
> CoverageInfoImpl[shakemap_padang_20090930] to
> /usr/local/geoserver-2.0.2/data_dir/workspaces/hazard/shakemap_padang_20090930/shakemap_padang_20090930/coverage.xml
>
>
> It happens when trying to upload a layer after having deleted it. I am not
> sure why this is as it seems perfectly OK to upload on top of an existing
> layer (using POST), so it may be the case that deletion doesn't clean
> everything up. I have attached a small shell script and two test files that
> will reproduce the problem.
> To run
>
>
> - Install and start a standard GeoServer on localhost:8080
> - Download attached files
> - Run sh persistence_error.sh
> - The output should end with the error we observed.
>
>
> Can anyone help?
> Many thanks
> Ole
>
>
>
>
>
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users