Bulk processing error message


#1

Hi
I’m writing a script in Python to S2_ Resample stacked files, but I get this error message which I don’t understand. It ends with this:

Error: org.esa.snap.core.gpf.common.resample.Resample.createInterpolatedMultiLevelImage(Lcom/bc/ceres/glevel/MultiLevelImage;DLjava/awt/geom/AffineTransform;IILjava/awt/Dimension;Lcom/bc/ceres/glevel/MultiLevelModel;Ljavax/media/jai/Interpolation;)Lcom/bc/ceres/glevel/MultiLevelImage;

I have included the whole output from Snap below.
Anna Birgitta

INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘S2RutOp’ registered (Python module: ‘s2_rut’, class: ‘S2RutOp’, root: ‘C:\Program Files\snap\s2tbx\modules\org-esa-snap-snap-rut.jar’)
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.gpf.descriptor.ToolAdapterOperatorDescriptor: Adapter META-INF has been automatically converted to the new format
SEVERE: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Failed to register module iCOR-L8. Problem: org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor : org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
---- Debugging information ----
message : org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
class : [Lorg.esa.snap.core.gpf.descriptor.DefaultSourceProductDescriptor;
required-type : [Lorg.esa.snap.core.gpf.descriptor.DefaultSourceProductDescriptor;
converter-type : com.thoughtworks.xstream.converters.collections.ArrayConverter
path : /operator/sourceProductDescriptors/org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
line number : 202
class[1] : org.esa.snap.core.gpf.descriptor.ToolAdapterOperatorDescriptor
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : 1.4.8

WARNING: org.esa.snap.SnapCoreActivator: org.esa.snap.core.dataio.ProductReaderPlugIn: Provider org.esa.s2tbx.dataio.muscate.MuscateProductReaderPlugin could not be instantiated
java.lang.NoSuchMethodError: org.esa.s2tbx.dataio.readers.BaseProductReaderPlugIn.(Ljava/lang/String;)V
at org.esa.s2tbx.dataio.muscate.MuscateProductReaderPlugin.(MuscateProductReaderPlugin.java:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at org.esa.snap.SnapCoreActivator.loadServices(SnapCoreActivator.java:60)
at org.esa.snap.core.dataio.ProductIOPlugInManager.(ProductIOPlugInManager.java:193)
at org.esa.snap.core.dataio.ProductIOPlugInManager$Holder.(ProductIOPlugInManager.java:199)
at org.esa.snap.core.dataio.ProductIOPlugInManager.getInstance(ProductIOPlugInManager.java:45)
at org.esa.snap.core.dataio.ProductIO.getProductReaderForInput(ProductIO.java:255)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.readProduct(DefaultCommandLineContext.java:55)
at org.esa.snap.core.gpf.main.CommandLineTool.readProduct(CommandLineTool.java:521)
at org.esa.snap.core.gpf.main.CommandLineTool.addProduct(CommandLineTool.java:466)
at org.esa.snap.core.gpf.main.CommandLineTool.getSourceProductMap(CommandLineTool.java:454)
at org.esa.snap.core.gpf.main.CommandLineTool.runOperator(CommandLineTool.java:295)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:284)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:101)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:16)

INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32632
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [granuleidentifier] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
java.lang.NoSuchMethodError: org.esa.snap.core.gpf.common.resample.Resample.createInterpolatedMultiLevelImage(Lcom/bc/ceres/glevel/MultiLevelImage;DLjava/awt/geom/AffineTransform;IILjava/awt/Dimension;Lcom/bc/ceres/glevel/MultiLevelModel;Ljavax/media/jai/Interpolation;)Lcom/bc/ceres/glevel/MultiLevelImage;
at org.esa.s2tbx.s2msi.resampler.S2ResamplerUtils.createInterpolatedImage(S2ResamplerUtils.java:64)
at org.esa.s2tbx.s2msi.resampler.S2Resampler.updateAngleBands(S2Resampler.java:266)
at org.esa.s2tbx.s2msi.resampler.S2Resampler.resample(S2Resampler.java:181)
at org.esa.s2tbx.s2msi.resampler.S2ResamplingOp.initialize(S2ResamplingOp.java:79)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387)
at org.esa.snap.core.gpf.main.CommandLineTool.runOperator(CommandLineTool.java:306)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:284)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:101)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:16)

Error: org.esa.snap.core.gpf.common.resample.Resample.createInterpolatedMultiLevelImage(Lcom/bc/ceres/glevel/MultiLevelImage;DLjava/awt/geom/AffineTransform;IILjava/awt/Dimension;Lcom/bc/ceres/glevel/MultiLevelModel;Ljavax/media/jai/Interpolation;)Lcom/bc/ceres/glevel/MultiLevelImage;


#2

Hi Anna,

you are not alone, I also don’t understand the error.
To explain the background. The error means that the method

Resample.createInterpolatedMultiLevelImage(sourceImage, sourceImageToModelTransform, referenceWidth, referenceHeight, tileSize, referenceMultiLevelModel, interpolation)

can not be invoked from the method

S2ResamplerUtils.createInterpolatedImage(...)

And this is understandable. Because the second parameter noDataValue is missing.

The correct call must be:

Resample.createInterpolatedMultiLevelImage(sourceImage, noDataValue, sourceImageToModelTransform, referenceWidth, referenceHeight, tileSize, referenceMultiLevelModel, interpolation)

That’s why the error happens and I understand it. But I do not understand how you get to the state of the code. The code is like this since more than a year and S2TBX (the caller) and SNAP (the called) have been updated simultaneously. And before the S2TBX didn’t use the method at all.
So, I wonder how this could happen.
Maybe a reinstallation of SNAP can help here or first try to get the latest updates if not yet done.


#3

Hi,
Thank you for your thorough explanation. :grinning:
I made sure Snap was updated and I also restarted my computer. I ran the code again, and it works.
Weird, but also great!!

Anna Birgitta