[Geoserver-devel] [jira] Created: (GEOS-1155) Class cast exceptions with PostPreProcessFilterSplittingVisitor

Class cast exceptions with PostPreProcessFilterSplittingVisitor
---------------------------------------------------------------

                 Key: GEOS-1155
                 URL: http://jira.codehaus.org/browse/GEOS-1155
             Project: GeoServer
          Issue Type: Bug
    Affects Versions: 1.5.1
            Reporter: Chris Holmes
            Assignee: Andrea Aime
            Priority: Blocker
             Fix For: 1.5.2, 1.6.0-beta1

Ok, I had this issue before, but didn't report it since I didn't have time to make a test case, and it didn't seem to pop up in major situations.

But it appears to be a major regression, since Like filters for one don't seem to work at all. This means that our geographical search example on sigma.openplans.org no longer works.

This is the request to http://sigma.openplans.org:8080/geoserver/wfs (if you want to try it I can turn on verbose error reporting to show the stack traces)

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  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: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:gnis_pop">
   <ogc:Filter>
    <ogc:PropertyIsLike wildCard="*" singleChar="." escape="\">
     <ogc:PropertyName>topp:full_name_lc</ogc:PropertyName>
     <ogc:Literal>seattle*</ogc:Literal>
    </ogc:PropertyIsLike>
   </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

The relevant stack trace is:
Caused by: java.lang.ClassCastException: org.geotools.filter.AttributeExpressionImpl
        at org.geotools.filter.visitor.PostPreProcessFilterSplittingVisitor.getFilterPre(PostPreProcessFilterSplittingVisitor.java:125)
        at org.geotools.data.jdbc.DefaultSQLBuilder.splitFilter(DefaultSQLBuilder.java:153)
        at org.geotools.data.jdbc.DefaultSQLBuilder.getPostQueryFilter(DefaultSQLBuilder.java:114)
        at org.geotools.data.postgis.PostgisFeatureStore.bounds(PostgisFeatureStore.java:881)
        at org.geotools.data.postgis.PostgisFeatureStore.getBounds(PostgisFeatureStore.java:864)
        at org.geotools.data.DefaultFeatureResults.getBounds(DefaultFeatureResults.java:207)
        at org.geotools.data.crs.ForceCoordinateSystemFeatureResults.getBounds(ForceCoordinateSystemFeatureResults.java:130)
        at org.geotools.gml.producer.FeatureTransformer$FeatureTranslator.encode(FeatureTransformer.java:407)
        at org.geotools.xml.transform.TransformerBase$XMLReaderSupport.parse(TransformerBase.java:625)

I also had problems with CQL filters when I was doing logical Filters (ANDs and ORs). So these may have a problem too. Example is:
http://sigma.openplans.org:8080/geoserver/wfs?service=WFS&request=GetFeature&typename=poly_landmarks&CQL_FILTER=cfcc%20<D82%20AND%20NOT%20DISJOINT(the_geom,LINESTRING(-73.99051%2040.4039,-73.96132%2040.67060))

Andrea, Saul said he'd look in to these if I could provide test cases, but my dev environment isn't set up for such things. Could you make test cases for AND filters and for LIKE filters?

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