[Geoserver-devel] [jira] Created: (GEOS-1946) Oracle 10g Error Performing SQL query (TRUE AND TRUE)

Oracle 10g Error Performing SQL query (TRUE AND TRUE)
-----------------------------------------------------

                 Key: GEOS-1946
                 URL: http://jira.codehaus.org/browse/GEOS-1946
             Project: GeoServer
          Issue Type: Bug
          Components: Oracle
    Affects Versions: 1.6.4
         Environment: gt2-oracle-spatial-2.4.3.jar, ojdbc14.jar, Mac Os X 10.5 and 10.4 ssh to Oracle 10gR2 on Debain
            Reporter: Michael Russalesi
            Assignee: Andrea Aime
            Priority: Blocker

After successfully setting up the DataStore and FeatureTypes with Oracle 10g, I ran the page:
http://localhost:8080/geoserver//wms?service=WMS&request=GetMap&format=image/png&width=800&height=600&srs=EPSG:4326&layers=topp:COUNTIES&styles=polygon&bbox=-177.1,13.71,-61.48,76.63
expecting a png with counties to appear (See full error message below).

/////excerpt/////
Error Performing SQL query: SELECT "ID", "GEOM" FROM "COUNTIES" WHERE ((TRUE AND TRUE) AND SDO_RELATE("GEOM",MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.24452499999998,13.605133333333335,-61.335474999999995,76.73486666666666)),'mask=anyinteract querytype=WINDOW') = 'TRUE' )
/////excerpt/////

When I run the query in SQLDeveloper without the (TRUE AND TRUE) AND statement the query executes without error. When I add the statement back, the error "Invalid relational operator" is exposed, which is identified in the log as the sqlexeption.

Why is the "(TRUE AND TRUE) AND" added to the sql statement?

The test data and setup I am using comes from the url:
http://www.oracle.com/technology/pub/articles/lokitz-spatial-geoserver.html

I have checked the oracle data, all SRID's are in order. All metadata information is in order.

/////FULL CONSOLE OUTPUT////
133342 [btpool0-4] INFO /geoserver - Loading WebApplicationContext for Spring FrameworkServlet 'dispatcher'
23 May 22:36:47 ERROR [data.jdbc] - Error Performing SQL query: SELECT "ID", "GEOM" FROM "COUNTIES" WHERE ((TRUE AND TRUE) AND SDO_RELATE("GEOM",MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.24452499999998,13.605133333333335,-61.335474999999995,76.73486666666666)),'mask=anyinteract querytype=WINDOW') = 'TRUE' )
java.sql.SQLException: ORA-00920: invalid relational operator

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
        at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1037)
        at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
        at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1272)
        at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
        at org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:905)
        at org.geotools.data.jdbc.JDBC1DataStore.getFeatureReader(JDBC1DataStore.java:627)
        at org.geotools.data.jdbc.JDBCFeatureCollection.reader(JDBCFeatureCollection.java:83)
        at org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:241)
        at org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:211)
        at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1585)
        at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:641)
        at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1461)
        at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1331)
        at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:262)
        at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:310)
        at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:424)
        at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
        at org.geoserver.ows.Dispatcher.response(Dispatcher.java:616)
        at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:192)
        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.doGet(FrameworkServlet.java:347)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1054)
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:170)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        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.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:358)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
        at org.mortbay.jetty.Server.handle(Server.java:303)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:320)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
23 May 22:36:47 ERROR [geotools.rendering] - Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT "ID", "GEOM" FROM "COUNTIES" WHERE ((TRUE AND TRUE) AND SDO_RELATE("GEOM",MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.24452499999998,13.605133333333335,-61.335474999999995,76.73486666666666)),'mask=anyinteract querytype=WINDOW') = 'TRUE' )
java.util.NoSuchElementException: Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT "ID", "GEOM" FROM "COUNTIES" WHERE ((TRUE AND TRUE) AND SDO_RELATE("GEOM",MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.24452499999998,13.605133333333335,-61.335474999999995,76.73486666666666)),'mask=anyinteract querytype=WINDOW') = 'TRUE' )
        at org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:53)
        at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1599)
        at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:641)
        at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1461)
        at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1331)
        at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:262)
        at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:310)
        at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:424)
        at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
        at org.geoserver.ows.Dispatcher.response(Dispatcher.java:616)
        at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:192)
        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.doGet(FrameworkServlet.java:347)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1054)
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:170)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        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.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:358)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
        at org.mortbay.jetty.Server.handle(Server.java:303)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:320)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Caused by: org.geotools.data.DataSourceException: Error Performing SQL query: SELECT "ID", "GEOM" FROM "COUNTIES" WHERE ((TRUE AND TRUE) AND SDO_RELATE("GEOM",MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.24452499999998,13.605133333333335,-61.335474999999995,76.73486666666666)),'mask=anyinteract querytype=WINDOW') = 'TRUE' )
        at org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:916)
        at org.geotools.data.jdbc.JDBC1DataStore.getFeatureReader(JDBC1DataStore.java:627)
        at org.geotools.data.jdbc.JDBCFeatureCollection.reader(JDBCFeatureCollection.java:83)
        at org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:241)
        at org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:211)
        at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1585)
        ... 57 more
Caused by: java.sql.SQLException: ORA-00920: invalid relational operator

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
        at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1037)
        at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
        at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1272)
        at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
        at org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:905)
        ... 62 more
23 May 22:36:47 INFO [geoserver.filters] - Not compressing output for mimetype: image/png

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