| I created a postgis table with an index field, a text field, a geometry field: {{CREATE TABLE test ( gid integer DEFAULT nextval('test_gid_seq'::regclass) NOT NULL, nome character varying(100), geom geometry(MultiLineString,4326) );}} In geoserver I created a layer connected to that table. In QGIS I created a WFS vector layer connected to the geoserver layer. I edit a feature. When I commit QGIS notifies me of the following error:
Transaction failed
org.geoserver.wfs.WFSTransactionException: Update error:
java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
I tried to execute it in the demo requests and got the same error. I put the request as logged by geoserver at the end of this field (I can't attach files: JIRA could not attach the file as there was a missing token. Please try attaching the file again.) I changed the request till I could get it to work. I started from the xml created by the demo requests tool and modified the tags from the outer tag to transform it to an xml similar to the qgis-generated one. First I modified the transaction tag followed by the Update tag and so on. The transactions were successful up to when I used the following xml: {{<Transaction xmlns="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xmlns:ws1="http://****.**" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://****.** http://******.***:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=ws1:test&SRSNAME=EPSG:4326&username=user1&password=******"> <Update xmlns="http://www.opengis.net/wfs" typeName="ws1:test"> <Property xmlns="http://www.opengis.net/wfs"> <Name xmlns="http://www.opengis.net/wfs">geom</Name> <Value xmlns="http://www.opengis.net/wfs"> <gml:MultiLineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"> <gml:lineStringMember> <gml:LineString> <gml:coordinates>8.00003043999999974,44.23241551000000271 8.00578959672930246,44.17149441442651892 8.06909135999999982,44.16719473999999934</gml:coordinates> </gml:LineString> </gml:lineStringMember> </gml:MultiLineString> </Value> </Property> <ogc:Filter> <ogc:FeatureId fid="test.4"/> </ogc:Filter> </Update> </Transaction>}} The problem seems to be in the Value tag. If the xml has <wfs:Value>...</wfs:Value> it works. If I change it to <Value xmlns="http://www.opengis.net/wfs">...</Value> I get the aforementioned error. Transaction failing: {{<Transaction xmlns="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xmlns:ws1="http://****.**" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://****.** http://******.***:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=ws1:test&SRSNAME=EPSG:4326&username=user1&password=******"> <Update xmlns="http://www.opengis.net/wfs" typeName="ws1:test"> <Property xmlns="http://www.opengis.net/wfs"> <Name xmlns="http://www.opengis.net/wfs">geom</Name> <Value xmlns="http://www.opengis.net/wfs"> <gml:MultiLineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"> <gml:lineStringMember> <gml:LineString> <gml:coordinates>8.00003043999999974,44.23241551000000271 8.00578959672930246,44.17149441442651892 8.06909135999999982,44.16719473999999934</gml:coordinates> </gml:LineString> </gml:lineStringMember> </gml:MultiLineString> </Value> </Property> <ogc:Filter> <ogc:FeatureId fid="test.4"/> </ogc:Filter> </Update> </Transaction>}} |