Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 [] - :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


share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.