[Geoserver-devel] [jira] (GEOS-6078) NPE on sorted join query

Benjamin Burns created BugGEOS-6078
NPE on sorted join query

Issue Type:

BugBug

Assignee:

Andrea Aime

Components:

WFS

Created:

07/Oct/13 5:21 PM

Description:

The following query generates a NullPointerException in org.geotools.data.sort.MergeSortDumper.canSort(), line 66.

<?xml version=“1.0” encoding=“UTF-8”?>
<wfs:GetFeature xmlns:wfs=“http://www.opengis.net/wfs/2.0” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” service=“WFS” version=“2.0.0” xsi:schemaLocation=“http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd” startIndex=“0” count=“10”>
<wfs:Query xmlns:example=“http://localhost.ben.local/example” typeNames=“example:type1 example:type2” srsName=“EPSG:4326” aliases=“type1 type2”>
<fes:Filter xmlns:fes=“http://www.opengis.net/fes/2.0”>
<fes:PropertyIsEqualTo matchCase=“true”>
<fes:ValueReference>type1/type2_id</fes:ValueReference>
<fes:ValueReference>type2/id</fes:ValueReference>
</fes:PropertyIsEqualTo>
</fes:Filter>
<fes:SortBy xmlns:fes=“http://www.opengis.net/fes/2.0”>
<fes:SortProperty>
<fes:ValueReference>type2/data_timestamp</fes:ValueReference>
<fes:SortOrder>DESC</fes:SortOrder>
</fes:SortProperty>
</fes:SortBy>
</wfs:Query>
</wfs:GetFeature>

If I drop the <fes:SortBy> tag, the query succeeds. Replacing the ValueReference with ‘type1/some_value’ yields the same error, however if I eliminate the ‘type1/’ in that modified value, the query succeeds.

Running it through the debugger, I can see that MergeSortDumper is testing the SortBy values to determine whether or not each field may be sorted as requested. However the property listed for my particular SortBy has not been resolved to the joined SimpleFeatureType. That is, it’s checking the SimpleFeatureType for ‘type1’ to determine if it contains the property ‘type2/data_timestamp’. When I pass ‘type1/some_value’, the same issue occurs, as the SimpleFeatureType being checked is unaware of its alias.

Project:

GeoServer

Priority:

MajorMajor

Reporter:

Benjamin Burns

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)