GeoServer
  1. GeoServer
  2. GEOS-3986

JDBC SQLException when publishing Oracle Spatial layer via Oracle extension JNDI datasource

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.0.2
    • Fix Version/s: None
    • Component/s: Oracle
    • Labels:
      None
    • Environment:
      Linux 64 bit RedHat, Apache Tomcat 6.0.20, Java 1.6.0, Oracle 10g, Oracle Java 6 JDBC driver (ojdbc6.jar)
    • Number of attachments :
      0

      Description

      I get the following stack trace when trying to publish a layer in Geoserver 2.0.2 using Oracle JNDI connection pool datastore. The data store configuration is successful, and I've configured the same layer from the same database in identical Tomcat instance using Geoserver 2.0 previously without any issues. When I go to the layer publish GUI steps, I am able to see all of the database tables in the schema, but clicking on the 'compute from data' link under Bounding Boxes causes the following stack trace dump.

      Identical setup works with GeoServer 2.0 deployed alongside 2.0.2 in the same Tomcat instance..... is it possible to deploy 2 GeoServer instances within the same Tomcat?

      java.lang.RuntimeException: java.io.IOException: Error occured calculating bounds
      at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:484)
      at org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:178)
      at org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:366)
      at org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:338)
      at org.vfny.geoserver.global.GeoServerFeatureSource.getBounds(GeoServerFeatureSource.java:526)
      at org.geoserver.catalog.CatalogBuilder.getNativeBounds(CatalogBuilder.java:460)
      at org.geoserver.web.data.resource.BasicResourceConfig$1.onSubmit(BasicResourceConfig.java:123)
      at org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:94)
      at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:128)
      at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:163)
      at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:297)
      at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:104)
      at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1239)
      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1316)
      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1418)
      at org.apache.wicket.RequestCycle.request(RequestCycle.java:532)
      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
      at org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:145)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)
      at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
      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:275)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
      at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.io.IOException: Error occured calculating bounds
      at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1053)
      at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:477)
      ... 79 more
      Caused by: java.sql.SQLException: Could not obtain native oracle connection for class org.apache.tomcat.dbcp.dbcp.PoolableConnection
      at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:471)
      at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:415)
      at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:405)
      at org.geotools.data.oracle.OracleDialect.decodeGeometryEnvelope(OracleDialect.java:352)
      at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1013)
      ... 80 more

        Activity

        Hide
        Andrea Aime added a comment -

        Odd. Does it work with ojdbc14.jar?

        Show
        Andrea Aime added a comment - Odd. Does it work with ojdbc14.jar?
        Hide
        Micah Wengren added a comment -

        Andrea,

        Thanks, you tipped me off to something that I had written up in a HOWTO from when I installed GeoServer 2.0 on the same system that I happened to overlook this time around. If you already are using an Oracle JDBC JAR within a Tomcat instance, and you deploy GeoServer WAR version, then install the Oracle datastore extension in WEB-INF/lib, the bundled ojdbc14.jar in the extension will conflict with the Tomcat instance-wide one in <tomcat_home>/lib (ojdbc6.jar in my case), causing the issue I saw. I guess this is not a bug, but might be worth noting in the Oracle datastore extension docs in case anyone else has a similar environment. I removed the bundled ojdbc14.jar from WEB-INF/lib, and problem solved. I guess I was smarter the last time I did this.....

        Show
        Micah Wengren added a comment - Andrea, Thanks, you tipped me off to something that I had written up in a HOWTO from when I installed GeoServer 2.0 on the same system that I happened to overlook this time around. If you already are using an Oracle JDBC JAR within a Tomcat instance, and you deploy GeoServer WAR version, then install the Oracle datastore extension in WEB-INF/lib, the bundled ojdbc14.jar in the extension will conflict with the Tomcat instance-wide one in <tomcat_home>/lib (ojdbc6.jar in my case), causing the issue I saw. I guess this is not a bug, but might be worth noting in the Oracle datastore extension docs in case anyone else has a similar environment. I removed the bundled ojdbc14.jar from WEB-INF/lib, and problem solved. I guess I was smarter the last time I did this.....
        Hide
        Miles Jordan added a comment -

        It's really not a bug. The same would happen with any other jars, on most Java applications.

        Show
        Miles Jordan added a comment - It's really not a bug. The same would happen with any other jars, on most Java applications.
        Hide
        Andrea Aime added a comment -

        Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

        Show
        Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

          People

          • Assignee:
            Andrea Aime
            Reporter:
            Micah Wengren
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: