deegree / deegree3

Official deegree repository providing geospatial core libraries, data access and advanced OGC web service implementations
https://www.deegree.org
GNU Lesser General Public License v2.1
146 stars 100 forks source link

WFS Update fails with unknown error #926

Open NasNasingud opened 5 years ago

NasNasingud commented 5 years ago

Dear developers,

I am using deegree in the latest version (3.4.0). I am facing an issue when updating features. The infrastructure: deegree runs within a Tomcat8 environment and is connected to an ORACLE 12c database. I am using a transaction-enabled SQLFeatureStore based on a schema.

The SQLFeatureStore looks as follows:

 <FeatureTypeMapping table="WFS_INSERT_FEATURE" name="app:feature" xmlns:app="http://someurl.com">
      <FIDMapping prefix="FTR_">
           <Column name="INSERT_ID" />
           <UUIDGenerator />
      </FIDMapping>

      <Primitive path="app:A"      mapping="FIELDA"  />
      <Primitive path="app:B"      mapping="FIELDB"   />
 </FeatureTypeMapping>

I run an update that looks as follows:

 <?xml version="1.0"?>
 <wfs:Transaction
 xmlns:wfs="http://www.opengis.net/wfs"
 xmlns:gml="http://www.opengis.net/gml"
 xmlns:ogc="http://www.opengis.net/ogc"
 xmlns:app="http://someurl.com"
 service="WFS"
 version="1.0.0">
     <wfs:Update handle="update1" typeName="app:feature">
         <wfs:Property>
             <wfs:Name>app:A</wfs:Name>
             <wfs:Value>New Value</wfs:Value>
         </wfs:Property>
         <ogc:Filter>
             <ogc:FeatureId fid="FTR_psraeysaainiaghmpehyokyijhkheudpkgwh"/>
         </ogc:Filter>
     </wfs:Update>
 </wfs:Transaction>

Unfortunately, I always get the following error:

 <?xml version='1.0' encoding='UTF-8'?>
 <ServiceExceptionReport xmlns="http://www.opengis.net/ogc">
      <ServiceException code="NoApplicableCode">
      Error performing update: null</ServiceException>
 </ServiceExceptionReport>

In the logs (catalina.out) there is nothing to see.

Do you have an idea about this issue? Thank you!

tfr42 commented 5 years ago

Can you please post the deegree workspace (incl. also the SQL DDL for the Oracle DB) here and also to the mailing list? Thanks.

NasNasingud commented 5 years ago

Sorry for the late reply. Here is the full deegree workspace.:

.deegree/testWFS/appschemas/schema.xsd

<?xml version='1.0' encoding='UTF-8'?>
<schema 
    xmlns="http://www.w3.org/2001/XMLSchema" 
    xmlns:gml="http://www.opengis.net/gml" 
    xmlns:app="http://someurl.com"
    targetNamespace="http://someurl.com" 
    elementFormDefault="qualified" 
    attributeFormDefault="unqualified">

  <import   namespace="http://www.opengis.net/gml" 
            schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>

<element name="feature" substitutionGroup="gml:_Feature" type="app:feature_type"/>

<complexType name="feature_type">
  <complexContent>
    <extension base="gml:AbstractFeatureType">
      <sequence>
        <element name="A" minOccurs="1" type="string"/>
        <element name="B" minOccurs="1" type="string"/>
      </sequence>
    </extension>
  </complexContent>
</complexType>

</schema>

.deegree/testWFS/datasources/feature/featurestore.xml

<SQLFeatureStore configVersion="3.4.0" 
  xmlns="http://www.deegree.org/datasource/feature/sql" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.deegree.org/datasource/feature/sql
  http://schemas.deegree.org/datasource/feature/sql/3.4.0/sql.xsd">

    <JDBCConnId>testdb</JDBCConnId>
    <StorageCRS srid="25832">EPSG:25832</StorageCRS>

    <GMLSchema>../../appschemas/schema.xsd</GMLSchema>

    <FeatureTypeMapping table="WFS_TEST" name="app:feature" xmlns:app="http://someurl.com">

        <FIDMapping prefix="FTR_">
            <Column name="INSERT_ID" />
            <UUIDGenerator />
        </FIDMapping>

        <Primitive path="app:A" mapping="FIELDA" />
        <Primitive path="app:B" mapping="FIELDB" />

    </FeatureTypeMapping>

</SQLFeatureStore>

.deegree/testWFS/jdbc/testdb.xml

<DataSourceConnectionProvider configVersion="3.4.0"
  xmlns="http://www.deegree.org/connectionprovider/datasource" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.deegree.org/connectionprovider/datasource 
  http://schemas.deegree.org/jdbc/datasource/3.4.0/datasource.xsd">

  <DataSource javaClass="org.apache.commons.dbcp.BasicDataSource" />

  <Property name="driverClassName" value="oracle.jdbc.OracleDriver" />
  <Property name="url" value="jdbc:oracle:thin:@dburl:1521:schema" />
  <Property name="username" value="user" />
  <Property name="password" value="pass" />
  <Property name="poolPreparedStatements" value="true" />
  <Property name="maxActive" value="10" />
  <Property name="maxIdle" value="10" />

</DataSourceConnectionProvider>

.deegree/testWFS/services/WFS.xml

<deegreeWFS configVersion="3.4.0"
  xmlns="http://www.deegree.org/services/wfs"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.deegree.org/services/wfs
  http://schemas.deegree.org/services/wfs/3.4.0/wfs_configuration.xsd">

  <SupportedVersions>
    <Version>1.0.0</Version>
    <Version>1.1.0</Version>
  </SupportedVersions>

  <FeatureStoreId>featurestore</FeatureStoreId>

  <EnableTransactions>true</EnableTransactions>
  <QueryCRS>urn:ogc:def:crs:EPSG::25832</QueryCRS>
  <QueryMaxFeatures>-1</QueryMaxFeatures>
</deegreeWFS>

The database structure is as follows:

create table WFS_TEST
(
  insert_id VARCHAR2(36) not null,
  fielda    VARCHAR2(64),
  fieldb    VARCHAR2(64)
)

...and there is exactly one dataset present:

insert into WFS_TEST (insert_id, fielda, fieldb)
values ('psraeysaainiaghmpehyokyijhkheudpkgwh', 'Old Value', 'Some other value');

The request, as stated in the first post, is as follows:

<?xml version="1.0"?>
 <wfs:Transaction
 xmlns:wfs="http://www.opengis.net/wfs"
 xmlns:gml="http://www.opengis.net/gml"
 xmlns:ogc="http://www.opengis.net/ogc"
 xmlns:app="http://someurl.com"
 service="WFS"
 version="1.0.0">
     <wfs:Update handle="update1" typeName="app:feature">
         <wfs:Property>
             <wfs:Name>app:A</wfs:Name>
             <wfs:Value>New Value</wfs:Value>
         </wfs:Property>
         <ogc:Filter>
             <ogc:FeatureId fid="FTR_psraeysaainiaghmpehyokyijhkheudpkgwh"/>
         </ogc:Filter>
     </wfs:Update>
 </wfs:Transaction>

The result for a WFS 1.0.0 request:

<?xml version='1.0' encoding='UTF-8'?>
<ServiceExceptionReport xmlns="http://www.opengis.net/ogc">
  <ServiceException code="NoApplicableCode">Error performing update: null</ServiceException>
</ServiceExceptionReport>

...and the result for a WFS 1.1.0 request:

<?xml version='1.0' encoding='UTF-8'?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd" version="1.0.0">
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>Error performing update: null</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

I am using deegree version 3.4.3 with deegree-sqldialect-oracle-3.4.3 and ORACLE 12c.

lgoltz commented 5 years ago

The error occurs if the column in the FIDMapping configuration does not contain a type attribute. If the type attribute is added the update request is successful:

<FIDMapping prefix="FTR_">
  <Column name="INSERT_ID" type="string" />
  <UUIDGenerator />
</FIDMapping>

type is optional (default is auto).

tfr42 commented 5 years ago

Funding welcome for fixing the reported issue.