Hi Tore,

I suspect this is something to do with JAI. Are the JAI and ImageIO jars packed?

This might not be the problem.

HTH

Andy
http://www.geog.leeds.ac.uk/people/a.turner/index.html
  

-----Original Message-----
From: Tore Halset [mailto:hal...@pvv.ntnu.no] 
Sent: 27 November 2015 23:47
To: geotools-gt2-users@lists.sourceforge.net
Subject: [Geotools-gt2-users] maven shade and ZonalStatistics problem

Hello.

My application works fine from eclise, but when packaged with maven shade to a 
single jar, ScaleCoverage.execute does not work any more. I use the 
org.apache.maven.plugins.shade.resource.ServicesResourceTransformer in maven to 
concat the META-INF services files.

This is with GeoTools 14.1 and java 8 on a mac. I have tried the single jar on 
ubuntu linux with Oracle Java 8 as well and it has the same problem.

Any clues to what to look for?

Regards,
Tore Halset.

The stack trace:
Nov 27, 2015 8:01:34 AM org.geotools.factory.FactoryRegistry scanForPlugins
WARNING: Can't load a service for category "Operation". Cause is 
"ServiceConfigurationError: org.opengis.coverage.processing.Operation: Provider 
org.geotools.coverage.processing.operation.ZonalStatistics could not be 
instantiated".
java.util.ServiceConfigurationError: org.opengis.coverage.processing.Operation: 
Provider org.geotools.coverage.processing.operation.ZonalStatistics could not 
be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:232)
        at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
        at 
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
        at 
org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:826)
        at 
org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:772)
        at 
org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:805)
        at 
org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:196)
        at 
org.geotools.coverage.processing.CoverageProcessor.scanForPlugins(CoverageProcessor.java:641)
        at 
org.geotools.coverage.processing.CoverageProcessor.getOperation(CoverageProcessor.java:518)
        at 
org.geotools.process.raster.ScaleCoverage.execute(ScaleCoverage.java:52)
Caused by: org.opengis.coverage.processing.OperationNotFoundException: No such 
"Zonal" operation for this processor.
        at 
org.geotools.coverage.processing.OperationJAI.getOperationDescriptor(OperationJAI.java:213)
        at 
org.geotools.coverage.processing.operation.ZonalStatistics.<init>(ZonalStatistics.java:87)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at java.lang.Class.newInstance(Class.java:442)
        at 
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
        ... 54 more

The content of META-INF/services/org.opengis.coverage.processing.Operation in 
the single jar:
org.geotools.coverage.processing.operation.Absolute
org.geotools.coverage.processing.operation.AddConst
org.geotools.coverage.processing.operation.Add
org.geotools.coverage.processing.operation.BandMerge
org.geotools.coverage.processing.operation.Convolve
org.geotools.coverage.processing.operation.Crop
org.geotools.coverage.processing.operation.DivideByConst
org.geotools.coverage.processing.operation.Exp
org.geotools.coverage.processing.operation.FilteredSubsample
org.geotools.coverage.processing.operation.Interpolate
org.geotools.coverage.processing.operation.Invert
org.geotools.coverage.processing.operation.Log
org.geotools.coverage.processing.operation.MaxFilter
org.geotools.coverage.processing.operation.MedianFilter
org.geotools.coverage.processing.operation.MinFilter
org.geotools.coverage.processing.operation.Mosaic
org.geotools.coverage.processing.operation.Multiply
org.geotools.coverage.processing.operation.MultiplyConst
org.geotools.coverage.processing.operation.Resample
org.geotools.coverage.processing.operation.Rescale
org.geotools.coverage.processing.operation.Scale
org.geotools.coverage.processing.operation.SelectSampleDimension
org.geotools.coverage.processing.operation.SubsampleAverage
org.geotools.coverage.processing.operation.SubtractConst
org.geotools.coverage.processing.operation.SubtractFromConst
org.geotools.coverage.processing.operation.Extrema
org.geotools.coverage.processing.operation.Histogram
org.geotools.coverage.processing.operation.ZonalStats
org.geotools.coverage.processing.operation.ZonalStatistics
org.geotools.coverage.processing.operation.Warp
org.geotools.coverage.processing.operation.Affine
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to