[Geoserver-devel] [jira] (GEOS-5012) WFS 1.1.1 request specifying resultType=hits causes ClassCastException

Martin Davis created GEOS-5012:
----------------------------------

             Summary: WFS 1.1.1 request specifying resultType=hits causes ClassCastException
                 Key: GEOS-5012
                 URL: https://jira.codehaus.org/browse/GEOS-5012
             Project: GeoServer
          Issue Type: Bug
          Components: WFS
    Affects Versions: 2.2.x
            Reporter: Martin Davis
            Assignee: Andrea Aime
            Priority: Minor

A WFS request specifying version 1.1.1 :

http://localhost:8080/geoserver/wfs?request=GetFeature&typename=globe_temp_dailies&version=1.1.1&resultType=hits

causes the following error:

java.lang.ClassCastException: net.opengis.wfs.ResultTypeType cannot be cast to net.opengis.wfs20.ResultTypeType net.opengis.wfs.ResultTypeType cannot be cast to net.opengis.wfs20.ResultTypeType

Stack trace is:

        BaseUrl = http://localhost:8080/geoserver/
        RequestCharset = UTF-8
20 Mar 10:47:07 INFO [geoserver.wfs] -
Request: getServiceInfo
20 Mar 10:47:07 ERROR [geoserver.ows] -
java.lang.ClassCastException: net.opengis.wfs.ResultTypeType cannot be cast to n
et.opengis.wfs20.ResultTypeType
        at net.opengis.wfs20.impl.GetFeatureTypeImpl.eSet(GetFeatureTypeImpl.jav
a:772)
        at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.jav
a:1081)
        at org.geotools.xml.EMFUtils.set(EMFUtils.java:67)
        at org.geoserver.ows.kvp.EMFKvpRequestReader.read(EMFKvpRequestReader.ja
va:93)
        at org.geoserver.wfs.kvp.GetFeatureKvpRequestReader.read(GetFeatureKvpRe
questReader.java:87)
        at org.geoserver.wfs.kvp.v2_0.GetFeatureKvpRequestReader.read(GetFeature
KvpRequestReader.java:39)
        at org.geoserver.ows.Dispatcher.parseRequestKVP(Dispatcher.java:1375)
        at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:620)
        at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:26
4)

If request does NOT specify resultType=hits, it works normally

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira