Uploaded image for project: 'GeoServer'
  1. GEOS-8386

failed get DescribeFeatureType request when exists uuid field and DataStore option Expose primary keys set true

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.11.1
    • Fix Version/s: 2.12.2, 2.13-beta
    • Component/s: WFS
    • Labels:
      None
    • Environment:

      windows 10 pro, postgresql 9.5, postgis 2.2.2, geoserver 2.11.1

      Description

      Hi!
      I trying to create layer with uuid identifier.
      I have already configured postgis sql datastore with existing layers.
      And i create table in this database and register layer with default geoservser sld called 'points'.

      When I trying to exec request DescribeFeatureType I recive nothing.
      request link sample
      Answer:

      <xsd:schema elementFormDefault="qualified" targetNamespace="gisbis"><xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://127.0.0.1:8083/geoserver/schemas/gml/3.1.1/base/gml.xsd"/></xsd:schema>
      

      and such error in geoserver log

      INFO   | jvm 1    | 2017/11/10 19:18:43 | 10 ноя 19:18:43 INFO [geoserver.wfs] - 
      INFO   | jvm 1    | 2017/11/10 19:18:43 | Request: getServiceInfo
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 10 ноя 19:18:43 INFO [geoserver.wfs] - 
      INFO   | jvm 1    | 2017/11/10 19:18:43 | Request: describeFeatureType
      INFO   | jvm 1    | 2017/11/10 19:18:43 |     service = WFS
      INFO   | jvm 1    | 2017/11/10 19:18:43 |     version = 1.1.0
      INFO   | jvm 1    | 2017/11/10 19:18:43 |     baseUrl = http://127.0.0.1:8083/geoserver/
      INFO   | jvm 1    | 2017/11/10 19:18:43 |     typeName[0] = {te}sssss
      INFO   | jvm 1    | 2017/11/10 19:18:43 |     outputFormat = text/xml; subtype=gml/3.1.1
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 10 ноя 19:18:43 WARN [geoserver.wfs] - Could not build xml schema for type: sssss
      INFO   | jvm 1    | 2017/11/10 19:18:43 | java.lang.NullPointerException: Could not find a type for property: id of type: java.util.UUID
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildComplexSchemaContent(FeatureTypeSchemaBuilder.java:771)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildSchemaContent(FeatureTypeSchemaBuilder.java:691)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildSchemaInternal(FeatureTypeSchemaBuilder.java:260)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.build(FeatureTypeSchemaBuilder.java:154)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.build(FeatureTypeSchemaBuilder.java:148)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.build(FeatureTypeSchemaBuilder.java:137)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.v1_1_0.XmlSchemaEncoder.doWrite(XmlSchemaEncoder.java:107)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.xml.v1_1_0.XmlSchemaEncoder.write(XmlSchemaEncoder.java:96)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.wfs.WFSDescribeFeatureTypeOutputFormat.write(WFSDescribeFeatureTypeOutputFormat.java:80)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.ows.Dispatcher.response(Dispatcher.java:1009)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:272)
      INFO   | jvm 1    | 2017/11/10 19:18:43 | 	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147)
      

      But when I set Expose primary keys in datastore options to false it state normally.
      Correct answer:

      <xsd:schema elementFormDefault="qualified" targetNamespace="te">
      	<xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://127.0.0.1:8083/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
      	<xsd:complexType name="sssssType">
      		<xsd:complexContent>
      			<xsd:extension base="gml:AbstractFeatureType">
      				<xsd:sequence>
      					<xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:GeometryPropertyType"/>
      				</xsd:sequence>
      			</xsd:extension>
      		</xsd:complexContent>
      	</xsd:complexType>
      	<xsd:element name="sssss" substitutionGroup="gml:_Feature" type="te:sssssType"/>
      </xsd:schema>
      

        Attachments

          Activity

            People

            • Assignee:
              dany111 Daniele Romagnoli
              Reporter:
              alexandr.bobrov alexandr bobrov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Stride room