[Geoserver-devel] [JIRA] (GEOS-8638) WFS join with ValueReference using local namespaces fail to execute

Andrea Aime created an issue

GeoServer / BugGEOS-8638

WFS join with ValueReference using local namespaces fail to execute

Issue Type:

BugBug

Assignee:

Unassigned

Components:

WFS

Created:

14/Mar/18 7:29 PM

Priority:

MediumMedium

Reporter:

Andrea Aime

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)

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100082-sha1:b581f55)

Atlassian logo