[Geoserver-users] How to disable Geoserver gdal extension

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 ?

Thank you.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-disable-Geoserver-gdal-extension-tp4643713p4643713.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,
please read below…

On Thu, Mar 22, 2012 at 8:22 AM, Surf <wreckman@anonymised.com> wrote:

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?

Please, let me know.
Regards,
Daniele

Thank you.


View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-disable-Geoserver-gdal-extension-tp4643713p4643713.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ing. Daniele Romagnoli
GeoSolutions S.A.S.
Software Engineer

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://it.linkedin.com/in/danieleromagnoli


Thank you for your note.

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]

Caused by:
java.lang.ClassNotFoundException:
org.geotools.coverageio.gdal.BaseGDALGridFormat

Thank you.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-disable-Geoserver-gdal-extension-tp4643713p4644917.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,
please, try to restore the gt-imageio-ext-gdal geotools jar on WEB-INF/lib and try to remove the low level imageio-ext-gdal** only.

WEB-INF/lib changes

Keep it:
gt-imageio-ext-gdal-2.7.4.jar

Remove it:
imageio-ext-gdal-bindings-1.4.5b.jar
imageio-ext-gdal***-1.0.8.jar

Please, let me know.
Best Regards,
Daniele

On Thu, Mar 22, 2012 at 3:36 PM, Surf <wreckman@anonymised.com> wrote:

Thank you for your note.

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]

Caused by:
java.lang.ClassNotFoundException:
org.geotools.coverageio.gdal.BaseGDALGridFormat

Thank you.


View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-disable-Geoserver-gdal-extension-tp4643713p4644917.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ing. Daniele Romagnoli
GeoSolutions S.A.S.
Software Engineer

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://it.linkedin.com/in/danieleromagnoli


Thank you.

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.

Thank you very much Daniele.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-disable-Geoserver-gdal-extension-tp4643713p4645195.html
Sent from the GeoServer - User mailing list archive at Nabble.com.