Have a small issue that I hope someone may be able to help with.
I am running Geoserver.war and Myapp.war both under an instance of Jetty.
Myapp requires the use of gdal occasionally but fails with:
Native library load failed.
java.lang.UnsatisfiedLinkError: Native Library C:\Program Files
(x86)\GDAL\gdaljni.dll already loaded in another classloader
This happens at gdal.AllRegister(), it seems that GeoServer has already
consumed gdal at startup. I have the gdal installation in my path.
I have tried to remove the jars that make up the equivalent of the gdal
extension plugin, but Geoserver produced some other errors and did not
startup.
I have also tried to remove gdal from the path and try to load it through
the Myapp application code but ran into some other dependency issues.
Another approach was to force Myapp to consume gdal at startup instead of
calling it as needed later in the execution, then somehow get Jetty to start
Myapp before Geoserver - but not sure how to get Jetty to fix the startup
order sequence. Seen some other posts about that problem.
Q: Is there a way to prevent Geoserver from consuming this native library so
that Myapp can use it instead ? I do not need to use the gdal extensions for
Geoserver. Alternatively, is there a way to share the gdal natives ?
Have a small issue that I hope someone may be able to help with.
I am running Geoserver.war and Myapp.war both under an instance of Jetty.
Myapp requires the use of gdal occasionally but fails with:
Native library load failed.
java.lang.UnsatisfiedLinkError: Native Library C:\Program Files
(x86)\GDAL\gdaljni.dll already loaded in another classloader
This happens at gdal.AllRegister(), it seems that GeoServer has already
consumed gdal at startup. I have the gdal installation in my path.
I have tried to remove the jars that make up the equivalent of the gdal
extension plugin, but Geoserver produced some other errors and did not
startup.
I have also tried to remove gdal from the path and try to load it through
the Myapp application code but ran into some other dependency issues.
Another approach was to force Myapp to consume gdal at startup instead of
calling it as needed later in the execution, then somehow get Jetty to start
Myapp before Geoserver - but not sure how to get Jetty to fix the startup
order sequence. Seen some other posts about that problem.
Q: Is there a way to prevent Geoserver from consuming this native library so
that Myapp can use it instead ? I do not need to use the gdal extensions for
Geoserver. Alternatively, is there a way to share the gdal natives ?
which geoserver version are you using?
Did you remove imageio-ext-gdal** from WEB-INF/lib? Which errors is throwing?
I am running Geoserver 2.1.3 under Jetty 8.0.4 on Win 7
After removing the gt-imageio-ext-gdal-2.7.4 I get multiple startup errors
that include these messages in between jetty errors, and Geoserver fails to
run.
org.geotools.factory.FactoryRegistry scanForPlugins
WARNING: Can't load a service for category "GridFormatFactorySpi". Cause is
"NoC
lassDefFoundError: org/geotools/coverageio/gdal/jp2ecw/JP2ECWFormatFactory".
Caused by:
java.lang.IllegalArgumentException: Cannot find class
[org.geotools.coverageio.g
dal.BaseGDALGridFormat]
I am running Geoserver 2.1.3 under Jetty 8.0.4 on Win 7
After removing the gt-imageio-ext-gdal-2.7.4 I get multiple startup errors
that include these messages in between jetty errors, and Geoserver fails to
run.
org.geotools.factory.FactoryRegistry scanForPlugins
WARNING: Can’t load a service for category “GridFormatFactorySpi”. Cause is
“NoC
lassDefFoundError: org/geotools/coverageio/gdal/jp2ecw/JP2ECWFormatFactory”.
Caused by:
java.lang.IllegalArgumentException: Cannot find class
[org.geotools.coverageio.g
dal.BaseGDALGridFormat]
I removed the 13 files and now Geoserver starts up without error.
Gdal extensions have been disabled and the new data source show a reduced
raster selection.
I tested Myapp and the gdal functions can now run successfully.