Uploaded image for project: 'GeoServer'
  1. GEOS-7578

OGR JNI UnsatisfiedLinkError with Java 1.8

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.2, 2.10-beta
    • Component/s: None
    • Labels:
      None
    • Environment:

      Centos 6.8, GDAL 1.11.2

      Description

      I am testing the OGR Store (Using gt-ogr-jni) with OpenFileGDB (http://frap.cdf.ca.gov/data/statewide/cdfadmin13_1.zip) on GeoServer.

      All of the following tests use CentOS release 6.8, and GDAL 1.11.2.


      With the GeoServer 2.8.0 WAR, tomcat-7.0.69, and openjdk-1.7.0.101, OGR works fine. I am able to add the store and view it in the OL preview.


      With the GeoServer 2.8.0 WAR, tomcat-8.0.35, and openjdk-1.7.0.101 OR openjdk-1.8.0.91-1.b14.el6 OR Oracle jdk1.8.0_92, I am still able to add the store and publish layers. However, if I try to view it in the OL preview (or any other WMS format), I get the following error:

      Caused by: java.lang.Exception: java.lang.UnsatisfiedLinkError: org.gdal.ogr.ogrJNI.Layer_SetSpatialFilter(JLorg/gdal/ogr/Layer;JLorg/gdal/ogr/Geometry;)V
              at org.geotools.renderer.lite.StreamingRenderer.fireErrorEvent(StreamingRenderer.java:495)
              at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:835)
              at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:548)
              ... 129 more
      Caused by: java.lang.UnsatisfiedLinkError: org.gdal.ogr.ogrJNI.Layer_SetSpatialFilter(JLorg/gdal/ogr/Layer;JLorg/gdal/ogr/Geometry;)V
              at org.gdal.ogr.ogrJNI.Layer_SetSpatialFilter(Native Method)
              at org.gdal.ogr.Layer.SetSpatialFilter(Layer.java:87)
              at org.geotools.data.ogr.jni.JniOGR.LayerSetSpatialFilter(JniOGR.java:257)
              at org.geotools.data.ogr.OGRFeatureSource.setLayerFilters(OGRFeatureSource.java:124)
              at org.geotools.data.ogr.OGRFeatureSource.getReaderInternal(OGRFeatureSource.java:230)
              at org.geotools.data.ogr.OGRFeatureSource.getReaderInternal(OGRFeatureSource.java:167)
              at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:634)
              at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:173)
              at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:58)
              at org.geotools.data.crs.ForceCoordinateSystemFeatureResults.openIterator(ForceCoordinateSystemFeatureResults.java:96)
              at org.geotools.feature.collection.AbstractFeatureCollection.features(AbstractFeatureCollection.java:69)
              at org.geotools.feature.collection.AbstractFeatureCollection.features(AbstractFeatureCollection.java:53)
              at org.geotools.renderer.lite.StreamingRenderer.drawPlain(StreamingRenderer.java:2282)
              at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1917)
              at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:833)
              ... 130 more
      

      Non-OGR GDAL formats (Raster) work fine.
      GeoServer 2.9.0 on Tomcat 8 / Java 8 shows the same behavior.


      With the GeoServer 2.8.0 WAR, tomcat-7.0.69, and openjdk-1.8.0.91-1.b14.el6 OR Oracle jdk1.8.0_92, all GDAL data formats fail to load. If I enable DEBUG level logging, I see the following:

      2016-06-10 20:39:16,059 DEBUG [data.ogr] - Error initializing GDAL/OGR library
      java.lang.UnsatisfiedLinkError: Native Library /usr/lib64/libgdaljni.so already loaded in another classloader
              at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1907)
              at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
              at java.lang.Runtime.loadLibrary0(Runtime.java:870)
              at java.lang.System.loadLibrary(System.java:1122)
              at org.geotools.data.ogr.jni.JniOGRDataStoreFactory.doIsAvailable(JniOGRDataStoreFactory.java:15)
              at org.geotools.data.ogr.OGRDataStoreFactory.isAvailable(OGRDataStoreFactory.java:165)
              at org.geotools.data.ogr.OGRDataStoreFactory.isAvailable(OGRDataStoreFactory.java:153)
              at org.geotools.data.DataAccessFinder.getAvailableDataStores(DataAccessFinder.java:212)
              at org.geotools.data.DataStoreFinder.getAvailableDataStores(DataStoreFinder.java:116)
              at org.geotools.data.DataAccessFinder.getAvailableDataStores(DataAccessFinder.java:195)
              at org.vfny.geoserver.util.DataStoreUtils.getAvailableDataStoreFactories(DataStoreUtils.java:343)
              at org.vfny.geoserver.util.DataStoreUtils.aquireFactory(DataStoreUtils.java:185)
              at org.geoserver.catalog.ResourcePool.getDataStoreFactory(ResourcePool.java:500)
              at org.geoserver.security.password.ConfigurationPasswordEncryptionHelper.getEncryptedFields(ConfigurationPasswordEncryptionHelper.java:73)
              at org.geoserver.security.password.ConfigurationPasswordEncryptionHelper.decode(ConfigurationPasswordEncryptionHelper.java:148)
              at org.geoserver.config.util.XStreamPersister$StoreInfoConverter.doUnmarshal(XStreamPersister.java:1591)
              at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
              at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
              at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1185)
              at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1169)
              at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1049)
              at org.geoserver.config.util.XStreamPersister.load(XStreamPersister.java:592)
              at org.geoserver.config.GeoServerLoader.depersist(GeoServerLoader.java:755)
              at org.geoserver.config.GeoServerLoader.readCatalog(GeoServerLoader.java:347)
              at org.geoserver.config.GeoServerLoader.readCatalog(GeoServerLoader.java:226)
              at org.geoserver.config.DefaultGeoServerLoader.loadCatalog(DefaultGeoServerLoader.java:36)
              at org.geoserver.config.GeoServerLoader.postProcessBeforeInitialization(GeoServerLoader.java:112)
              at org.geoserver.config.GeoServerLoaderProxy.postProcessBeforeInitialization(GeoServerLoaderProxy.java:59)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
              at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
              at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
              at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)
              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
              at org.geoserver.platform.GeoServerContextLoaderListener.contextInitialized(GeoServerContextLoaderListener.java:23)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
              at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
              at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tbarsballe Torben Barsballe
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: