[Geoserver-devel] [jira] Created: (GEOS-1365) GeoJSON Output format - null pointer error when the geometry property is not required

GeoJSON Output format - null pointer error when the geometry property is not required
--------------------------------------------------------------------------------------

                 Key: GEOS-1365
                 URL: http://jira.codehaus.org/browse/GEOS-1365
             Project: GeoServer
          Issue Type: Bug
          Components: WFS
    Affects Versions: 1.6.0-beta3
         Environment: windows XP - Geoserver.exe installer
            Reporter: claudio silvestri
            Assignee: Andrea Aime

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&quot;
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <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&quot;&gt;
&#8722;
  <ServiceException>

      java.lang.NullPointerException
java.lang.NullPointerException
</ServiceException>
</ServiceExceptionReport>

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira