Testing with 2.25.1:
-
WFS_getFeatureBBOX.url: result
-
WFS_getFeatureBetween-1.0.xml: states.1, states.7, states.9,states.13,…
-
WFS_getFeatureBetween-1.1.xml: Same error message Caused by: java.lang.ArrayIndexOutOfBoundsException: Can handle 3 attributes only, index is 3
This is the same error you found on 2.25.2: The result should only contain the attributes requested, or that are required to filter the content.
The query checks one attribute:
ogc:Filter
ogc:PropertyIsBetween
ogc:PropertyNametopp:LAND_KM</ogc:PropertyName>
ogc:LowerBoundaryogc:Literal100000</ogc:Literal></ogc:LowerBoundary>
ogc:UpperBoundaryogc:Literal150000</ogc:Literal></ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
The query lists three attributes to return:
wfs:PropertyNametopp:STATE_NAME</wfs:PropertyName>
wfs:PropertyNametopp:LAND_KM</wfs:PropertyName>
wfs:PropertyNametopp:the_geom</wfs:PropertyName>
But the results is coming back with 4 values (not sure why) and it fails when trying to store a the additional values in a feature…
From the logs:
Request: getFeature
service = WFS
version = 1.1.0
baseUrl = http://localhost:8080/geoserver/
query[0]:
propertyName[0] = topp:STATE_NAMEpropertyName[0] = topp:LAND_KMpropertyName[0] = topp:the_geom
filter = [ topp:LAND_KM BETWEEN 100000 AND 150000 ]
typeName[0] = {http://www.openplans.org/topp}states
outputFormat = text/xml; subtype=gml/3.1.1
resultType = results
…
17 Jun. 08:57:44 DEBUG [data.transform] - The original query for feature extraction Query:
feature type: states
filter: [ topp:LAND_KM BETWEEN 100000 AND 150000 ]
[properties: the_geom, STATE_NAME, LAND_KM] has been transformed to Query:
feature type: states
filter: [ topp:LAND_KM BETWEEN 100000 AND 150000 ]
[properties: STATE_NAME, LAND_KM, the_geom]
…
17 Jun. 08:57:44 ERROR [geoserver.ows] -
java.lang.RuntimeException: Error encoding object to xml-element
at org.geotools.xsd.Encoder.processChildren(Encoder.java:1028)
at org.geotools.xsd.Encoder.encode(Encoder.java:655)
at org.geotools.xsd.Encoder.encode(Encoder.java:553)
at org.geoserver.wfs.xml.GML3OutputFormat.encode(GML3OutputFormat.java:397)
at org.geoserver.wfs.xml.GML3OutputFormat.write(GML3OutputFormat.java:323)
at org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutputFormat.java:199)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:1034)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:273)
…
Caused by: java.lang.ArrayIndexOutOfBoundsException: Can handle 3 attributes only, index is 3
at org.geotools.feature.simple.SimpleFeatureBuilder.set(SimpleFeatureBuilder.java:259)
at org.geotools.feature.simple.SimpleFeatureBuilder.add(SimpleFeatureBuilder.java:203)
at org.geotools.feature.simple.SimpleFeatureBuilder.addAll(SimpleFeatureBuilder.java:210)
at org.geotools.feature.simple.SimpleFeatureBuilder.addAll(SimpleFeatureBuilder.java:216)
at org.geotools.feature.simple.SimpleFeatureBuilder.build(SimpleFeatureBuilder.java:349)
at org.geotools.data.crs.ReprojectFeatureIterator.next(ReprojectFeatureIterator.java:125)
at org.geotools.data.crs.ReprojectFeatureIterator.next(ReprojectFeatureIterator.java:62)
at org.geoserver.security.decorators.SecuredSimpleFeatureIterator.next(SecuredSimpleFeatureIterator.java:40)
at org.geoserver.security.decorators.SecuredSimpleFeatureIterator.next(SecuredSimpleFeatureIterator.java:19)
at org.geotools.gml2.simple.FeatureCollectionEncoderDelegate.encode(FeatureCollectionEncoderDelegate.java:124)
at org.geotools.xsd.Encoder.processChildren(Encoder.java:1026)
So this needs a new bug report:
···
–
Jody Garnett