Closed fvanderbiest closed 9 years ago
@landryb recommends hardlinking gdal.jar from geoserver's WEB-INF/lib
@pmauduit: I do not understand if I need to remove/exclude other jars from this folder
I guess at least imageio-ext-gdal-bindings-1.9.2.jar
as suggested by https://github.com/georchestra/georchestra/blob/master/geoserver/NATIVE_LIBS.md#last-manual-checks
Basically, we need to provide a version of jars that won't call System.loadLibrary, i.e. exclude the jars containing the following classes:
org/gdal/gdal/*
org/gdal/ogr/*
These should be provided by the gdal/ogr project via gdal.jar provided by the gdal library (on debian typically located into /usr/share/java/gdal.jar, but is also provided by geosolutions as a dependency named imageio-ext-gdal-bindings-1.9.2.jar
- name can vary).
These two following classes are provided by geotools and imageioext-project and should be patched to be used in georchestra (not currently the case):
it/geosolutions/imageio/gdalframework/GDALUtilities
org/geotools/data/ogr/jni/JniOGRDataStoreFactory
These 2 classes are contained into the following jars (version numbers may vary):
imageio-ext-gdalframework-x.y.z.jar
gt-ogr-jni-x.y.jar
But for now we cannot remove them from the webapps nor exclude them at compile-level because it also contains necessary code.
As discussed, a quick win could be to:
exclude imageio-ext-gdal-bindings-1.9.2.jar from geoserver webapp
Using https://github.com/georchestra/georchestra/blob/master/doc/build.md#geoserverwarexcludes for instance ...
Tried with
./mvn -Dserver=template '-Dgeoserver.war.excludes=WEB-INF/lib/imageio-ext-gdal-bindings-*.jar' -Dmaven.test.skip=true -Papp-schema,authkey,charts,control-flow,css,csw,dds,dxf,feature-aggregate,feature-pregeneralized,geosearch,gdal,imagemap,inspire,istyler,kml,libjpeg-turbo,mysql,ogr,pyramid,script,spatialite,xslt,wps,w3ds clean install
... but the imageio-ext-gdal-bindings-1.9.2.jar is still there.
I guess it should be done at pom.xml level, but there are some weird things with the current build system for geoserver, being investigated ...
Re hardlinking gdal.jar, i had a hard time remembering why it was needed, but thanks to my irc logs...
LifecycleException: start: : java.io.IOException: Failed to access resource /WEB-INF/lib/gdal.jar
This happens when geoserver wants to access gdal.jar for some reason if it's a symlink. Using a hardlink works...
geoserver_1 | Jan 13, 2015 10:51:08 AM it.geosolutions.imageio.gdalframework.GDALUtilities loadGDAL geoserver_1 | WARNING: Failed to load the GDAL native libs. This is not a problem unless you need to use the GDAL plugins: they won't be enabled. geoserver_1 | java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path