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

WFS join with ValueReference using local namespaces fail to execute

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.13.1, 2.14-RC
    • Component/s: WFS
    • Labels:

      Description

      On a request like this one:

      <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" count="10" service="WFS" startIndex="0" version="2.0.0"> <wfs:Query xmlns:ns54="http://cite.opengeospatial.org/gmlsf" typeNames="ns54:PrimitiveGeoFeature ns54:PrimitiveGeoFeature"> <Filter xmlns="http://www.opengis.net/fes/2.0"> <Intersects> <ValueReference>ns54:PrimitiveGeoFeature/ns54:surfaceProperty</ValueReference> <ValueReference>ns54:PrimitiveGeoFeature/ns54:curveProperty</ValueReference> </Intersects> </Filter> </wfs:Query> </wfs:GetFeature>
      

      GeoServer fails as follows:

      org.geoserver.wfs.WFSException: Extracted invalid join filter [ ns54:PrimitiveGeoFeature/ns54:surfaceProperty intersects ns54:PrimitiveGeoFeature/ns54:curveProperty ], it uses the unkonwn alias/typename ns54:PrimitiveGeoFeature
      	at org.geoserver.wfs.JoinExtractingVisitor.rewriteAndSortOtherFilters(JoinExtractingVisitor.java:387)
      	at org.geoserver.wfs.JoinExtractingVisitor.getJoins(JoinExtractingVisitor.java:255)
      	at org.geoserver.wfs.GetFeature.run(GetFeature.java:449)
      	at org.geoserver.wfs.DefaultWebFeatureService20.getFeature(DefaultWebFeatureService20.java:110)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      

      The issue happens in JoinExtractingVisitor, which is expecting to find aliases as prefixes, an unqualified type name, or one qualified with the internal prefix, for the properties, while in this case there is a local prefix instead, ns54.
      Probably the easiest fix for this case is to preventively rewrite the filter so that it uses the expected prefix instead of the local one (due to how the rest of the JoinExtractingVisitor logic works)

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                aaime Andrea Aime
                Reporter:
                aaime Andrea Aime
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: