[Geoserver-devel] [JIRA] (GEOS-9087) JDBC Datastore "encode functions" might cause a ClassCastException

Alessio Fabiani created an issue

GeoServer / BugGEOS-9087

JDBC Datastore “encode functions” might cause a ClassCastException

Issue Type:

BugBug

Assignee:

Unassigned

Created:

07/Jan/19 12:59 PM

Priority:

MediumMedium

Reporter:

Alessio Fabiani

JDBC Datastore “encode functions” options enabled, might cause the following exception

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.opengis.feature.type.AttributeDescriptor
at org.geotools.data.jdbc.FilterToSQL.visit(FilterToSQL.java:549)
at org.geotools.filter.LikeFilterImpl.accept(LikeFilterImpl.java:488)
at org.geotools.data.jdbc.FilterToSQL.visit(FilterToSQL.java:639)
at org.geotools.data.jdbc.FilterToSQL.visit(FilterToSQL.java:584)
at org.geotools.filter.AndImpl.accept(AndImpl.java:48)
at org.geotools.data.jdbc.FilterToSQL.encode(FilterToSQL.java:287)
at org.geotools.data.jdbc.FilterToSQL.encodeToString(FilterToSQL.java:314)
at org.geotools.jdbc.JDBCDataStore.filter(JDBCDataStore.java:3500)
at org.geotools.jdbc.JDBCDataStore.filter(JDBCDataStore.java:3489)
at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:3601)
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:592)
… 142 more

After some investigation, it seems that this might happen when trying to use an encoded function with a “LIKE” expression, e.g.:

CQL_FILTER=(strToLowerCase(“survey_name”)%20LIKE%20%27%25l3nam1983b%25%27)

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100097-sha1:569a681)

Atlassian logo