To reproduce the problem, one needs a Postgesql/Postgis data store. The table in the database:
CREATE TABLE image (
id text,
"imageURL" text,
dummy_geom geometry,
image_id serial
);
The WFS request against geoserver:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction xmlns:kpa="http://atlases.gcrc.carleton.ca/ns/kpa" xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://atlases.gcrc.carleton.ca/ns/kpa http://127.0.0.1:8080/geoserver/wfs?request=DescribeFeatureType&SERVICE=WFS&VERSION=1.0.0&TYPENAME=kpa:image" version="1.0.0" service="WFS" lockAction="ALL"><Insert><kpa:image fid="newkpa:image.9223372036854775807"><kpa:id></kpa:id>
<kpa:imageURL></kpa:imageURL>
<kpa:dummy_geom><gml:MultiPoint srsName="EPSG:4326"><gml:pointMember><gml:Point><gml:coordinates decimal="." cs="," ts=" ">-106.46338791772723,69.60092733055353</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</kpa:dummy_geom>
</kpa:image>
</Insert>
</Transaction>
Here is the reply from geoserver:
<?xml version="1.0" encoding="UTF-8"?><wfs:WFS_TransactionResponse version="1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://127.0.0.1:8080/geoserver/schemas/wfs/1.0.0/WFS-transaction.xsd"><wfs:InsertResult><ogc:FeatureId fid="none"/></wfs:InsertResult> <wfs:TransactionResult> <wfs:Status> <wfs:FAILED/> </wfs:Status> <wfs:Message>Error performing insert</wfs:Message> </wfs:TransactionResult></wfs:WFS_TransactionResponse>
Here is part of the log:
25 Apr 21:04:29 ERROR [data.jdbc] - SQL Exception writing geometry columnERROR: null value in column "image_id" violates not-null constraint
org.postgresql.util.PSQLException: ERROR: null value in column "image_id" violates not-null constraint
Here is the PostGIS SQL request (obtained from Wireshark):
C....PC_3.P.....INSERT INTO "public"."image" ("id","imageURL","dummy_geom","image_id") VALUES ('','',setSRID('0000000004000000010000000001C05A9DA825CC00004051667597E80000'::geometry,4326),null)...B............D....P.E.........S...
Note that the "image_id" attribute is included with a "null" value, yet it was not included in the WFS request.
Here is the SQL request that should be sent (performed via PSQL):
kpa=# INSERT INTO image ("id","imageURL","dummy_geom") VALUES ('','',setSRID('0000000004000000010000000001C05A9DA825CC00004051667597E80000'::geometry,4326));
INSERT 33126 1
To reproduce the problem, one needs a Postgesql/Postgis data store. The table in the database:
CREATE TABLE image (
id text,
"imageURL" text,
dummy_geom geometry,
image_id serial
);
The WFS request against geoserver:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction xmlns:kpa="http://atlases.gcrc.carleton.ca/ns/kpa" xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://atlases.gcrc.carleton.ca/ns/kpa http://127.0.0.1:8080/geoserver/wfs?request=DescribeFeatureType&SERVICE=WFS&VERSION=1.0.0&TYPENAME=kpa:image" version="1.0.0" service="WFS" lockAction="ALL"><Insert><kpa:image fid="newkpa:image.9223372036854775807"><kpa:id></kpa:id>
<kpa:imageURL></kpa:imageURL>
<kpa:dummy_geom><gml:MultiPoint srsName="EPSG:4326"><gml:pointMember><gml:Point><gml:coordinates decimal="." cs="," ts=" ">-106.46338791772723,69.60092733055353</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</kpa:dummy_geom>
</kpa:image>
</Insert>
</Transaction>
Here is the reply from geoserver:
<?xml version="1.0" encoding="UTF-8"?><wfs:WFS_TransactionResponse version="1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://127.0.0.1:8080/geoserver/schemas/wfs/1.0.0/WFS-transaction.xsd"><wfs:InsertResult><ogc:FeatureId fid="none"/></wfs:InsertResult> <wfs:TransactionResult> <wfs:Status> <wfs:FAILED/> </wfs:Status> <wfs:Message>Error performing insert</wfs:Message> </wfs:TransactionResult></wfs:WFS_TransactionResponse>
Here is part of the log:
25 Apr 21:04:29 ERROR [data.jdbc] - SQL Exception writing geometry columnERROR: null value in column "image_id" violates not-null constraint
org.postgresql.util.PSQLException: ERROR: null value in column "image_id" violates not-null constraint
Here is the PostGIS SQL request (obtained from Wireshark):
C....PC_3.P.....INSERT INTO "public"."image" ("id","imageURL","dummy_geom","image_id") VALUES ('','',setSRID('0000000004000000010000000001C05A9DA825CC00004051667597E80000'::geometry,4326),null)...B............D....P.E.........S...
Note that the "image_id" attribute is included with a "null" value, yet it was not included in the WFS request.
Here is the SQL request that should be sent (performed via PSQL):
kpa=# INSERT INTO image ("id","imageURL","dummy_geom") VALUES ('','',setSRID('0000000004000000010000000001C05A9DA825CC00004051667597E80000'::geometry,4326));
INSERT 33126 1