7

I am getting the below exception while editing and saving data in spatial table.

Response

<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows http://x.x.x.x:80/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>{http://x.x.x.x/geoserver/capacity/org}EDIT_TEST is read-only</ows:ExceptionText>
 </ows:Exception>
</ows:ExceptionReport>

I checked the following as suggested in a previous thread:

  1. Primary Key - PK is available in the spatial table and type Number.
  2. User access - On geoserver in stores i have a 'XXXX' user and in oracle i have granted all privileges on the table. But still getting the same issue.

Do we need to do any settings on geoserver?

#

I have noticed that every time new FEATID is generating. Spatial table has primary key and sequence(tableName_colname_sequence). Can any one help me out why the correct featid is not going in the request

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs            http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
           <wfs:Delete typeName="capacity:EDIT_TEST" xmlns:capacity="http://x.x.x.x/geoserver/capacity/org">  
              <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
                 <ogc:FeatureId fid="EDIT_TEST.fid-270312d3_14ce5aac044_-7ce8"/>
            </ogc:Filter></wfs:Delete>
</wfs:Transaction>
6

For anyone who is having the same issue, this worked for me:

In Geoserver, Go to "Data Security" section.

Check if writing is allowed to anonymous user for all the workspace (..w), or create a new rule giving you access to the workspace in where your wfs-t layers are.

Try Again.

  • your comment was VERY helpfull, as nothing in the Geoserver UI for the corresponding layer resembles the need of roles set up – Ilya Yevlampiev Nov 29 '18 at 19:41
1

Another reason for GeoServer considering a table read only is having a column with a type that GeoServer does not understand... and thus cannot write onto.

If that's the case, you should find in your logs, the first time that table is used, and at least at the default logging level, a message such as:

Could not find mapping for theColumn, ignoring the column and setting the feature type read only

0

I had a problem with WFS like you, I solved it by enabling jsonp in Geoserver

enter image description here

0

I had the same "read-only" issue and couldn't find a way. I did all the stuff mentioned here (primary key on pg table, wfs-t setup, Data Security etc) and on all the other stack- and gis-overflow articles regarding wfs-t problems.

So I found out the hard way that there are two ways of how to define a layer on geoserver.

  1. The way I did it all the time by defining a SQL query (Configure SQL View) - this is not the right way if you want to edit the data from the table via wfs-t
  2. Choose one of the layers in the list you get when creating a new layer - this is the right way if you want to edit the data from the table via wfs-t (using this way geoserver knows which column is the primary key - just by defining a "sql-view-layer" and selecting a PK there is not enough)

Something to keep in mind is that you can only access tables for wfs-t which are in the schema you defined in your datastore, while you can query tables from other schemas using the sql-view. If you have tables in multiple schemas you will have to create multiple data-stores if you want to edit them via wfs-t.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.