Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using Geoserver REST API to create a new PostGIS feature type in Geoserver doing a POST to an url following this pattern http://localhost:8080/geoserver/rest/workspaces/my_ws/datastores/my_ds/featuretypes.json

and passing it data like this:

{'featureType': {'name':'my_featuretype_name'}}.

The post effectively create the feature type but is returning a 500 code error which mean:

Internal server error.

According to the official doc the returned code is supposed to be 201.

Looking in Geoserver log show me the following error:

INFO [org.geoserver] - Loaded feature type 'my_featuretype_name', enabled

ERROR [geoserver.rest] - :Resource named 'my_featuretype_name' already exists in store: 'my_ds'

The table already exist in my database but is not published as a layer in Geoserver.

What I want to do is to reproduce, with the REST API, the exact same action of clicking publish for an existing table in my database in the add new layer page of the Geoserver Web admin.

Am I doing something wrong?

Thanks a lot

Etienne

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.