Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6.0-beta3
-
Fix Version/s: 1.6.0-beta4
-
Component/s: WFS
-
Labels:None
-
Environment:windows XP - Geoserver.exe installer
-
Number of attachments :
Description
The GetFeature method cause a NullPointer exception when the geometry properties is not specified.
This does happen only with outputFormat=json
example query based on the included demo (1.6.0-beta3)
<!-- Performs a between filter to find the states with an area
between 100,000 and 150,000.
Also, it just returns the STATE_NAME, LAND_KM, and geometry
(instead of all the attributes).
-->
<wfs:GetFeature service="WFS" version="1.0.0"
outputFormat="json"
xmlns:topp="http://www.openplans.org/topp"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">
<wfs:Query typeName="topp:states">
<ogc:PropertyName>topp:STATE_NAME</ogc:PropertyName>
<ogc:PropertyName>topp:LAND_KM</ogc:PropertyName>
<ogc:Filter>
<ogc:PropertyIsBetween>
<ogc:PropertyName>topp:LAND_KM</ogc:PropertyName>
<ogc:LowerBoundary><ogc:Literal>100000</ogc:Literal></ogc:LowerBoundary>
<ogc:UpperBoundary><ogc:Literal>150000</ogc:Literal></ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
RESULT:
<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
−
<ServiceException>
java.lang.NullPointerException
java.lang.NullPointerException
</ServiceException>
</ServiceExceptionReport>
The only work around I have found is to add (before the filter)
<ogc:PropertyName>topp:the_geom</ogc:PropertyName>
but this cause an overhead