[Geoserver-devel] [jira] Created: (GEOS-1702) KVPRequestReader throws exception when it should ignore the parameter

KVPRequestReader throws exception when it should ignore the parameter
---------------------------------------------------------------------

                 Key: GEOS-1702
                 URL: http://jira.codehaus.org/browse/GEOS-1702
             Project: GeoServer
          Issue Type: Bug
          Components: Global, WCS
            Reporter: Andrea Aime
            Assignee: Andrea Aime
             Fix For: 1.7.0-beta1

When doing a wcs 1.1.1 DescribeCoverage request such as:
http://localhost:8080/geoserver/wcs?service=WCS&request=DescribeCoverage&version=1.1.1&identifier=topp:tazbm
the result is a class cast exception:
{code}
java.lang.ClassCastException: net.opengis.ows.v1_1_0.impl.CodeTypeImpl cannot be cast to java.util.Collection
  at net.opengis.wcs.v1_1_1.impl.DescribeCoverageTypeImpl.eSet(DescribeCoverageTypeImpl.java:96)
  at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:654)
  at org.geotools.xml.EMFUtils.set(EMFUtils.java:58)
  at org.geoserver.ows.kvp.EMFKvpRequestReader.read(EMFKvpRequestReader.java:83)
  at org.geoserver.wcs.kvp.DescribeCoverageKvpRequestReader.read(DescribeCoverageKvpRequestReader.java:35)
  at org.geoserver.ows.Dispatcher.parseRequestKVP(Dispatcher.java:1002)
  at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:371)
{code}

This is happening because of an inconsistency between the xsd model and the kvp param names. The actual kvp parameter name
is "identifiers", but the xml has "identifier" for the same place.
"identifier" used as a kvp parameter should be ignored, but instead emf reflection tries to set it into the "identifier" field of DescribeCoverageType, throwing an exception (the "IdentifiersKvpParser" did not activate because of the different name of the param).
In fact the above request should fail with an exception stating the "identifiers" param is missing.

To avoid this kind of issue we should provide the kvp parser with a list of names we care about, and have it forget about all of the others. Maybe as an optional parameter, since in wfs requests this cannot happen (there are no incosistencies I know of between the kvp and the xsd there).

--
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