Hello,

I finally got the gdal-2.2.2 java-binding to work again with Geoserver.

However it only works with Geoserver 2.12-rc1 but NOT with Geoserver 2.12.0 !!

Comparing both directories 2.12-rc1/WEB-INF/lib and 2.12.0/WEB-INF/lib it seems 
that the gdal-extension related JAR files "imageio-ext-*-1.18.jar" from version 
2.12.0 does have issues...

Geoserver 2.12-rc1 still uses the old imageio-ext-*-1.17.jar and importing 
ENVIHDR files works!

Note that the "imageio-ext-gdal-bindings-1.9.2.jar" was removed from 
WEB-INF/lib and replaced with my own compiled "gdal.jar" java binding file in 
both 2.12-rc1 and 2.12.0

I tried everything possible with 2.12.0 but I really think the gdal extension 
doesn't work properly (at least on macOS 10.11.x), it always displays the error:
Caused by: java.lang.RuntimeException: The Provided input is not supported by 
this reader

Can someone confirm this gdal-import (EnviHDR) issue from 2.12.0 on another 
platform ?

Regards,

gilles

> On 18 Oct 2017, at 21:59, Gilles Celli <[email protected]> wrote:
> 
> Hello Torben,
> 
> Thanks for your quick reply.
> 
> Well I forgot to mention that I removed the 
> "imageio-ext-gdal-bindings-1.9.2.jar" java binding from WEB-INF/lib (even 
> tried it out without copying the compiled gdal.jar).
> 
> Setting then JAVA_OPTS to point to gdal lib path for Tomcat in setenv.sh have 
> worked for me before...
> export JAVA_OPTS="-Djava.library.path=/usr/local/Cellar/gdal/1.11.5_3/lib/"
> 
> Yeah right I've read geoserver's v2.12 changelog that it was actually added 
> back in....
> 
>> Also, as a side note, this should have been posted on the user list rather 
>> than the developer list.
> 
> Ah sorry, for that ! Next new thread will be on the user list.
> 
> Will re-check everything again tomorrow....something is missing or wrong...
> 
> Cheers,
> 
> Gilles
> 
> 
> 
>> On 18 Oct 2017, at 19:54, Torben Barsballe <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hi Giles,
>> 
>> If you have compiled your own version of GDAL, in addition to copying over 
>> the gdal.jar, you will also have to remove the existing 
>> imageio-ext-gdal-bindings-1.9.2.jar from WEB-INF/lib, otherwise there may be 
>> conflicts in the bindings. See here 
>> <http://docs.geoserver.org/latest/en/user/data/raster/gdal.html#installing-gdal-native-libraries>
>>  for more details.
>> 
>> For a few releases, including most of 2.11.x, this jar was not included by 
>> default, and it was assumed users would copy in the correct bindings jar for 
>> their version of GDAL. However, there were complaints, so it was added back 
>> in.
>> 
>> This may be what is causing your issue.
>> If this doesn't fix it, then it may be a problem with your data.
>> 
>> Also, as a side note, this should have been posted on the user list rather 
>> than the developer list.
>> 
>> Torben
>> 
>> On Wed, Oct 18, 2017 at 8:01 AM, Gilles Celli <[email protected] 
>> <mailto:[email protected]>> wrote:
>> Hello,
>> 
>> I've problems getting gdal 1.x or gdal 2.2.x with Geoserver 2.12.0 
>> (War-Archive) to succesfully load a ENVIHdr raster file.
>> 
>> The EnviHDR Store is displayed in the "Add new stores" page, but trying to 
>> add a raster file it displays the error:
>> * Could not list layers for this store, an error occurred retrieving them: 
>> The Provided input is not supported by this reader
>> 
>> Using macOS 10.11.6 / JAVA SDK 1.8.0_144 / Tried with Tomcat 8.0.47 & Tomcat 
>> 8.5.23 / Geoserver 2.12.0 / Tried with gdal 1.15 from Homebrew and gdal-2.2.2
>> 
>> If I do check the status page, the gdal module is succesfully loaded:
>> http://localhost:8080/geoserver/rest/about/status 
>> <http://localhost:8080/geoserver/rest/about/status>
>> 
>> • Module name: ImageI/O-Ext GDAL Coverage Extension
>>              • Module : gs-gdal
>>              • Component : GridCoverage2DReader
>>              • Version : 1.1.18
>>              • Enabled : true
>>              • Available : true
>>              • Message : JNI GDAL Wrapper Version: INF/lib/gdal
>> GDAL Version: 1.11.5
>> GDAL Release Date: 20160701
>> GDAL Build Info: PAM_ENABLED=YES
>> OGR_ENABLED=YES
>> 
>> Checking "catalina.2017-10-18.log" (daily log) file it seems that the gdal 
>> native lib is loaded:
>> 18-Oct-2017 16:52:25.302 INFO [localhost-startStop-1] 
>> it.geosolutions.imageio.gdalframework.GDALUtilities.loadGDAL GDAL Native 
>> Library loaded (version: 1.11.5)
>> 
>> However checking "catalina.out", I get the following error when pushing the 
>> "Save" button from the "Add Raster Data Source / EnviHDR page:
>> 
>> Caused by: java.lang.RuntimeException: The Provided input is not supported 
>> by this reader
>>      at 
>> it.geosolutions.imageio.gdalframework.GDALImageReader.setInput(GDALImageReader.java:764)
>>      at javax.imageio.ImageReader.setInput(ImageReader.java:380)
>>      at 
>> org.geotools.coverageio.BaseGridCoverage2DReader.<init>(BaseGridCoverage2DReader.java:173)
>>      at 
>> org.geotools.coverageio.gdal.BaseGDALGridCoverage2DReader.<init>(BaseGDALGridCoverage2DReader.java:84)
>>      at 
>> org.geotools.coverageio.gdal.envihdr.EnviHdrReader.<init>(EnviHdrReader.java:68)
>>      at 
>> org.geotools.coverageio.gdal.envihdr.EnviHdrFormat.getReader(EnviHdrFormat.java:75)
>>      at 
>> org.geotools.coverageio.gdal.envihdr.EnviHdrFormat.getReader(EnviHdrFormat.java:37)
>>      at 
>> org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1506)
>>      at 
>> org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1452)
>>      at 
>> org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:59)
>>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>      at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>      at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>      at java.lang.reflect.Method.invoke(Method.java:498)
>>      at 
>> org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:147)
>>      at com.sun.proxy.$Proxy24.getGridCoverageReader(Unknown Source)
>>      at 
>> org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:95)
>> 
>> 
>> Tomcat's setenv.sh contains even the lib path for gdal:
>> export JAVA_OPTS="-Djava.library.path=/usr/local/Cellar/gdal/1.11.5_3/lib/"
>> 
>> The "gdal.jar" java-binding from the "Homebrew package manager" was copied 
>> in geoserver/WEB-INF/lib along with the files from "gdal 2.12.0 extension"
>> 
>> I even compiled gdal 2.2.2 with java support by myself, with the usual setup 
>> (gdal.jar binding etc.) but still same problem...
>> 
>> In fact when it worked back then with geoserver 2.11.2 I wrote myself a 
>> tutorial on how to install gdal with geoserver on macOS, see here:
>> http://www.ecgs.lu/gilles/enabling-gdal-java-binding-for-geoserver-on-macos/ 
>> <http://www.ecgs.lu/gilles/enabling-gdal-java-binding-for-geoserver-on-macos/>
>> 
>> However it doesn't even work with geoserver 2.11.2 anymore....
>> 
>> Any clues ?
>> 
>> Regards,
>> 
>> Gilles Celli
>> 
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org <http://slashdot.org/>! 
>> http://sdm.link/slashdot <http://sdm.link/slashdot>
>> _______________________________________________
>> Geoserver-devel mailing list
>> [email protected] 
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel 
>> <https://lists.sourceforge.net/lists/listinfo/geoserver-devel>
>> 
>> 
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! 
> http://sdm.link/slashdot_______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to