Geoserver returns an exception if a property-filter for a property of the type string contains a letter, but in the db the property is of the type integer
----------------------------------------------------------------------------------------------------------------------------------------------------------
Key: GEOS-1911
URL: http://jira.codehaus.org/browse/GEOS-1911
Project: GeoServer
Issue Type: Bug
Components: Community schema
Environment: AWDIP Geoserver with BOM data
Reporter: Stefan Hansen
Assignee: Andrea Aime
Geoserver returns an exception if a property-filter for a property of the type string contains a letter, but in the db the property is of the type integer.
For example to this request:
<wfs:GetFeature service="WFS" version="1.1.0"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:om="http://www.opengis.net/om/1.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:sa="http://www.opengis.net/sampling/1.0"
xmlns:aw="http://www.water.gov.au/awdip"
xmlns:ows="http://www.opengis.net/ows"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd"
maxFeatures="5">
<wfs:Query typeName="aw:SiteLocation">
<ogc:Filter>
<ogc:Not>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>gml:name</ogc:PropertyName>
<ogc:Literal>BLA</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Not>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
Geoserver responds with:
<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/ows http://venus.adl.ardec.com.au:5580/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.util.NoSuchElementException:
Could not aquire
feature:org.geotools.data.DataSourceException: Error
Performing SQL query: select id AS station_id FROM
geom_stations WHERE lat &lt;&gt; 0 AND (NOT
(id = &apos;BLA&apos;)) Could not aquire
feature:org.geotools.data.DataSourceException: Error
Performing SQL query: select id AS station_id FROM
geom_stations WHERE lat &lt;&gt; 0 AND (NOT
(id = &apos;BLA&apos;)) Error Performing SQL
query: select id AS station_id FROM geom_stations
WHERE lat &lt;&gt; 0 AND (NOT (id =
&apos;BLA&apos;)) ERROR: invalid input syntax
for integer: &quot;BLA&quot;</ows:ExceptionText>
<ows:ExceptionText>Details:</ows:ExceptionText>
<ows:ExceptionText>org.geoserver.platform.ServiceException:
java.util.NoSuchElementException: Could not aquire
feature:org.geotools.data.DataSourceException: Error
Performing SQL query: select id AS station_id FROM
geom_stations WHERE lat <> 0 AND (NOT (id = 'BLA'))
at
org.geoserver.ows.Dispatcher.exception(Dispatcher.java:1163)
at
org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:198)
at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595) Caused by:
java.util.NoSuchElementException: Could not aquire
feature:org.geotools.data.DataSourceException: Error
Performing SQL query: select id AS station_id FROM
geom_stations WHERE lat <> 0 AND (NOT (id = 'BLA'))
at
org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:53)
at
org.geotools.data.complex.ComplexDataStore.getCount(ComplexDataStore.java:247)
at
org.geotools.data.complex.MappingFeatureSource$1.size(MappingFeatureSource.java:168)
at
org.geotools.feature.iso.FeatureCollections.getSize(FeatureCollections.java:114)
at
org.geoserver.wfs.GetFeature.run(GetFeature.java:447)
at
org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:108)
at
sun.reflect.GeneratedMethodAccessor160.invoke(Unknown
Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at
org.geoserver.wfs.WFSLogger.invoke(WFSLogger.java:44)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy0.getFeature(Unknown Source) at
sun.reflect.GeneratedMethodAccessor205.invoke(Unknown
Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.geoserver.security.OperationSecurityInterceptor.invoke(OperationSecurityInterceptor.java:41)
at
org.geoserver.ows.Dispatcher.execute(Dispatcher.java:495)
at
org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:188)
... 41 more Caused by:
org.geotools.data.DataSourceException: Error
Performing SQL query: select id AS station_id FROM
geom_stations WHERE lat <> 0 AND (NOT (id = 'BLA'))
at
org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:917)
at
org.geotools.data.jdbc.JDBC1DataStore.getFeatureReader(JDBC1DataStore.java:626)
at
org.geotools.data.jdbc.JDBCFeatureCollection.reader(JDBCFeatureCollection.java:82)
at
org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:241)
at
org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:211)
at
org.geotools.data.complex.ComplexDataStore.getCount(ComplexDataStore.java:239)
... 61 more Caused by:
org.postgresql.util.PSQLException: ERROR: invalid
input syntax for integer: "BLA" at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:239)
at
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at
org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:906)
... 66 more </ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
--
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