Ignore:
Timestamp:
2014-10-20T21:27:03+02:00 (10 years ago)
Author:
donvip
Message:

[josm_geotools] fix #josm10652 - robustness against JAI initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java

    r30734 r30755  
    4747            // Update registry with com.sun.media.jai.imageioimpl.ImageReadWriteSpi (only class listed javax.media.jai.OperationRegistrySpi)
    4848            // it would be safer to parse this file instead, but a JAI update is very unlikely as it has not been modified since 2005
    49             new ImageReadWriteSpi().updateRegistry(registry);
     49            try {
     50                new ImageReadWriteSpi().updateRegistry(registry);
     51            } catch (IllegalArgumentException e) {
     52                // See #10652: IllegalArgumentException: A descriptor is already registered against the name "ImageRead" under registry mode "rendered"
     53                Main.warn("geotools: error in JAI/ImageReadWriteSpi initialization: "+e.getMessage());
     54            }
    5055
    5156            // Update registry with GeoTools registry file
     
    5661                    registry.updateFromStream(in);
    5762                }
    58             } catch (IOException e) {
    59                 Main.error("geotools: error in JAI initialization: "+e.getMessage());
     63            } catch (IOException | IllegalArgumentException e) {
     64                Main.error("geotools: error in JAI/GeoTools initialization: "+e.getMessage());
    6065            }
    6166        }
Note: See TracChangeset for help on using the changeset viewer.