I'm pretty new to Ubuntu and cannot figure out how to resolve this issue. I'm running the latest Geoserver WAR (2.13.0) on Tomcat7 on Ubuntu 16.04.4. I've added the GDAL library in order to support ECW files on Geoserver. When i try to create a new layer in Geoserver with ECW, the server crashes. The tomcat log /var/log/tomcat7/catalina.out shows the following error:

terminate called after throwing an instance of 'std::length_error'
what():  basic_string::_S_create

When i run:

/usr/lib/javainfo/gdalinfo.sh --formats | grep ECW

as expected it shows the ECW support:

ECW (rw): ERDAS Compressed Wavelets (SDK 3.x)
JP2ECW (rw+v): ERDAS JPEG2000 (SDK 3.x)

When i test it with a sample ECW file:

sh /usr/lib/javainfo/gdalinfo.sh /home/ubuntu/TILES_CM_062.ecw

I get the error below:

terminate called after throwing an instance of 'std::length_error'
what():  basic_string::_S_create Aborted (core dumped)

I can successfully create a GeoTIFF layer and when i check a sample GeoTiff with /usr/lib/javainfo/gdalinfo.sh there is no issue.

When i run:

/usr/lib/javainfo/gdalinfo.sh --version

it shows:

GDAL 1.9.2, released 2012/10/08

Here's the background to what i've tried so far. I followed these instructions at https://geoserver.geo-solutions.it/edu/en/install_run/imageio_ext_install.html. Specifically I have done the following:

  1. Downloaded https://demo.geo-solutions.it/share/github/imageio-ext/releases/1.1.X/1.1.16/native/gdal/gdal-data.zip
  2. Extracted into /usr/local/share/gdal/data
  3. Set the GDAL_DATA environment variable (GDAL_DATA=/usr/local/share/gdal)
  4. Also set GDAL_SKIP=JP2ECW as per https://demo.geo-solutions.it/share/github/imageio-ext/releases/1.1.X/1.1.16/native/gdal/linux/notes_on_ECW_and_JP2ECW.txt
  5. Downloaded https://demo.geo-solutions.it/share/github/imageio-ext/releases/1.1.X/1.1.16/native/gdal/linux/gdal192-Ubuntu12-gcc4.6.3-x86_64.tar.gz
  6. Extracted into /usr/lib

I also went through http://docs.geoserver.org/stable/en/user/data/raster/gdal.html.

I also tried installing the latest GDAL:

 sudo apt-get install gdal-bin

Running this again shows:

gdal-bin is already the newest version (2.1.3+dfsg-1~xenial2).

I think the issue must be to do with the GDAL library install?

  • Are you aware that the ECW 3.3 SDK was released over 10 years ago (2006 I think)? It is pretty buggy and definitely very out of date. I would avoid it at all costs and use the latest SDK.
    – user2856
    Apr 6, 2018 at 5:28
  • Thanks for the comments. In the end, I used this Docker to build the server. I can recommend this as a quick way to deploy! github.com/DenisCarriere/Geoserver-Docker
    – Neil
    Apr 10, 2018 at 6:00
  • That docker uses a recent ECW SDK (5.2.1 from 2015). Not the most recent (which is 5.4), but much better than the ancient 3.3 you were trying to use.
    – user2856
    Apr 19, 2018 at 3:16


Browse other questions tagged or ask your own question.